Skip to content

Commit

Permalink
Restricted conversion of map 5078 to random encounter for Co8 only
Browse files Browse the repository at this point in the history
  • Loading branch information
DMD authored and DMD committed Sep 9, 2016
1 parent 0b8e86c commit 0176740
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
21 changes: 14 additions & 7 deletions TemplePlus/fixes/generalfixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,22 @@ class SpellSlingerGeneralFixes : public TempleFix
writeHex(0x100D4259, "90 90 90 90 90 90");


// caravan_encounter_fix.txt // looks like it has been updated since then too! 13D6 instead of 13D5
writeHex(0x1006ED1E, "04");


writeHex(0x1006FE1B + 1, "D6 13");
writeHex(0x1007173C + 1, "D6 13");
writeHex(0x1012BDF2 + 1, "D6 13");
writeHex(0x1012C1EC + 1, "D6 13");
writeHex(0x1012C361 + 1, "D6 13");

if (temple::Dll::GetInstance().HasCo8Hooks())
{
// caravan_encounter_fix.txt // looks like it has been updated since then too! 13D6 instead of 13D5
writeHex(0x1006ED1E, "04");
// expanded RE map range to 5078
writeHex(0x1006FE1B + 1, "D6 13");
writeHex(0x1007173C + 1, "D6 13");
writeHex(0x1012BDF2 + 1, "D6 13");
writeHex(0x1012C1EC + 1, "D6 13");
writeHex(0x1012C361 + 1, "D6 13");

}


// D20STDF_fix.txt

Expand Down
8 changes: 6 additions & 2 deletions TemplePlus/gamesystems/mapsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void MapSystem::LoadModule() {
alwaysFog = true;
}
else if (!_stricmp(tolower(config.fogOfWar).c_str(), "unfogged")) {
alwaysUnfog = true;;
alwaysUnfog = true;
}


Expand Down Expand Up @@ -521,7 +521,11 @@ int MapSystem::GetMapIdByType(MapType type)

bool MapSystem::IsRandomEncounterMap(int mapId) const
{
return mapId >= 5070 && mapId <= 5078;
auto maxRange = 5077;
if (temple::Dll::GetInstance().HasCo8Hooks())
maxRange = 5078;

return mapId >= 5070 && mapId <= maxRange;
}

bool MapSystem::IsVignetteMap(int mapId) const
Expand Down

0 comments on commit 0176740

Please sign in to comment.