Skip to content

Commit

Permalink
Detect the engine version for "Ahriman's Prophecy" correctly
Browse files Browse the repository at this point in the history
It is RPG Maker 2003 1.0.8.0 but their exe file lacks a VERSIONINFO.

The code segment size is checked instead to detect the version correctly.
  • Loading branch information
Ghabry committed Sep 23, 2023
1 parent a32e965 commit 61db60f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/exe_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,14 @@ int EXEReader::FileInfo::GetEngineType(bool& is_maniac_patch) const {
// VALUE! or Rpg2k3 < 1.0.2.1
// Check CODE segment size to be sure
if (code_size > 0xB0000) {
return Player::EngineRpg2k3;
if (code_size >= 0xC7400) {
// Code segment size for >= 1.0.5.0
// In theory this check is unnecessary because this version has a VERSIONINFO.
// However the modified exe shipped with Ahriman's Prophecy is a 1.0.8.0 without a VERSIONINFO.
return Player::EngineRpg2k3 | Player::EngineMajorUpdated;
} else {
return Player::EngineRpg2k3;
}
}

return Player::EngineRpg2k | Player::EngineMajorUpdated;
Expand Down

0 comments on commit 61db60f

Please sign in to comment.