Skip to content

Commit

Permalink
patch ushabti != 100 error
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Oct 8, 2023
1 parent 7260e21 commit ba1612e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/game_api/game_patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,14 @@ void set_skip_tiamat_cutscene(bool skip)
else
recover_mem("set_skip_tiamat_cutscene");
}

void patch_ushabti_error()
{
// nops MessageBoxA("Number of generated Ushabti statues isn't 100!")
static bool once = false;
if (once)
return;
const auto offset = get_address("ushabti_error");
write_mem_prot(offset, "\x90\x90\x90\x90\x90\x90"sv, true);
once = true;
}
1 change: 1 addition & 0 deletions src/game_api/game_patches.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ void patch_liquid_OOB();
void set_skip_olmec_cutscene(bool skip);
void patch_tiamat_kill_crash();
void set_skip_tiamat_cutscene(bool skip);
void patch_ushabti_error();
8 changes: 8 additions & 0 deletions src/game_api/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2026,6 +2026,14 @@ std::unordered_map<std::string_view, AddressRule> g_address_rules{
.at_exe()
.function_start(),
},
{
"ushabti_error"sv,
// it's one of the few calls to MessageBoxA, nagging about some Ushabti statues
PatternCommandBuffer{}
.find_inst("4c 89 e8 4c 29 e0 48 3d 20 03 00 00"_gh)
.offset(0x21)
.at_exe(),
},
};
std::unordered_map<std::string_view, size_t> g_cached_addresses;

Expand Down
1 change: 1 addition & 0 deletions src/game_api/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ State& State::get()
patch_orbs_limit();
patch_olmec_kill_crash();
patch_liquid_OOB();
patch_ushabti_error();
}
else
{
Expand Down

0 comments on commit ba1612e

Please sign in to comment.