SaveMapInfo: fix/unfix encounter_rate
MODIFY
generator/csv/setup.csv
generator/csv/setup.csv
@@ -11,9 +11,10 @@ SaveMapEvent,void Fixup(const RPG::EventPage& page),
SaveMapEvent,void UnFixup(const RPG::EventPage& page),
SaveMapInfo,void Setup(),
SaveMapInfo,void Setup(const RPG::Map& map),"rpg_map.h"
-SaveMapInfo,void Setup(const RPG::MapInfo& map_info),"rpg_mapinfo.h"
SaveMapInfo,void Fixup(const RPG::Map& map),
+SaveMapInfo,void Fixup(const RPG::MapInfo& map),"rpg_mapinfo.h"
SaveMapInfo,void UnFixup(const RPG::Map& map),
+SaveMapInfo,void UnFixup(const RPG::MapInfo& map),
SaveSystem,void Setup(),
SaveSystem,void Fixup(),
SaveSystem,void UnFixup(),

MODIFY
src/generated/rpg_savemapinfo.h
src/generated/rpg_savemapinfo.h
Binary files a/src/generated/rpg_savemapinfo.h and b/src/generated/rpg_savemapinfo.h differ

MODIFY
src/lsd_reader.cpp
src/lsd_reader.cpp
@@ -134,7 +134,7 @@ std::unique_ptr<RPG::Save> LSD_Reader::LoadXml(std::istream& filestream) {
return std::unique_ptr<RPG::Save>(save);
}
-RPG::Save LSD_Reader::ClearDefaults(const RPG::Save& save_in, const RPG::Map& map) {
+RPG::Save LSD_Reader::ClearDefaults(const RPG::Save& save_in, const RPG::MapInfo& map_info, const RPG::Map& map) {
auto save = save_in;
save.system.UnFixup();
@@ -142,6 +142,7 @@ RPG::Save LSD_Reader::ClearDefaults(const RPG::Save& save_in, const RPG::Map& ma
actor.UnFixup();
}
save.map_info.UnFixup(map);
+ save.map_info.UnFixup(map_info);
return save;
}

MODIFY
src/lsd_reader.h
src/lsd_reader.h
@@ -44,7 +44,7 @@ namespace LSD_Reader {
/**
* Returns a copy of the save data with defaults cleared.
*/
- RPG::Save ClearDefaults(const RPG::Save& save, const RPG::Map& map);
+ RPG::Save ClearDefaults(const RPG::Save& save, const RPG::MapInfo& map_info, const RPG::Map& map);
/**
* Loads Savegame.

MODIFY
src/rpg_fixup.cpp
src/rpg_fixup.cpp
@@ -281,7 +281,14 @@ void RPG::SaveMapInfo::Fixup(const RPG::Map& map) {
FixInt(chipset_id, map.chipset_id);
}
+void RPG::SaveMapInfo::Fixup(const RPG::MapInfo& map) {
+ FixInt(encounter_rate, map.encounter_steps);
+}
void RPG::SaveMapInfo::UnFixup(const RPG::Map& map) {
UnFixInt(chipset_id, map.chipset_id);
}
+
+void RPG::SaveMapInfo::UnFixup(const RPG::MapInfo& map) {
+ UnFixInt(encounter_rate, map.encounter_steps);
+}

MODIFY
src/rpg_setup.cpp
src/rpg_setup.cpp
@@ -91,10 +91,6 @@ void RPG::SaveMapInfo::Setup(const RPG::Map& map) {
parallax_vert_speed = map.parallax_sy;
}
-void RPG::SaveMapInfo::Setup(const RPG::MapInfo& map_info) {
- encounter_rate = map_info.encounter_steps;
-}
-
void RPG::SaveSystem::Setup() {
const RPG::System& system = Data::system;
screen = 0;

SaveMapInfo: fix/unfix encounter_rate