Skip to content

Commit

Permalink
patch liquids pool error with removal of some old liquid instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Oct 8, 2023
1 parent 340eaf5 commit 7260e21
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/game_api/game_patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,16 @@ void patch_liquid_OOB()
write_mem_prot(new_code_addr + 6, rel, true);
write_mem_prot(new_code_addr + 16, rel - 10, true);

// replace "Ran out of liquids pool!" with jmp out of the main loop, which effectively
// fixes the problem of spawning too much liquid, simply removing some old ones when new is spawned
{
const size_t message_addr = offset - 0x10f;
// replace call MessageBoxA with
// jmp whatever (after of the main while do-while != 5 loop)
// nop
write_mem_prot(message_addr, "\xE9\x72\x01\x00\x00\x90"sv, true);
}

once = true;
}

Expand Down

0 comments on commit 7260e21

Please sign in to comment.