Skip to content

Commit

Permalink
Proper water floor fix (#46)
Browse files Browse the repository at this point in the history
- Fix some dumb code check to include deeper water levels.
- Removed old fix.
  • Loading branch information
tilgep authored Oct 17, 2023
1 parent fc1bcb8 commit c1b6e7c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
25 changes: 13 additions & 12 deletions gamedata/cs2fixes.games.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,6 @@
"windows" "\xFF\x15\x2A\x2A\x2A\x2A\x84\xC0\x0F\x85\x2A\x2A\x2A\x2A\xB9"
"linux" ""
}
// String: "player_jump", then find 42C80000h or in pseudocode "*(a2 + 68) = 1120403456;", changing from 100 to 145
"CheckJumpButtonWater"
{
"library" "server"
"windows" "\xC8\x42\xEB\x2A\x48\x8B\x4B\x30"
"linux" "\xC8\x42\x66\x0F\xEF\xE4\x41\x0F\x2F\x65"
}
// String: "CCSPlayerPawnBase::SwitchTeam", just keep in mind this is actually CCSPlayerController::SwitchTeam
"CCSPlayerController_SwitchTeam"
{
Expand All @@ -197,6 +190,14 @@
"library" "server"
"windows" "\x3C\x01\x49\x8B\x5B\x10\x49\x8B\x7B\x18\x0F\x97\xC0\x41\x0F\x28"
"linux" "\x3C\x01\x0F\x97\xC0\x48\x81\xC4\x50\x01"
}

// String: "PlayerMove_PostMove", generally function called before the postmove func is CategorizePosition, find the == 1.0 check in CategorizePosition
"CategorizeUnderwater"
{
"library" "server"
"windows" "\x75\x2A\xB3\x01\xEB\x2A\x32\xDB\x45\x32\xED"
"linux" "\x0F\x45\xC1\x4D\x85\xC0\x0F\x95\xC1\x20\xC8"
}
}
"Offsets"
Expand Down Expand Up @@ -230,16 +231,16 @@
"windows" "\xBE\x02"
"linux" "\x83\xFE\x02"
}
"FixWaterFloorJump"
{
"windows" "\x11\x43"
"linux" "\x11\x43"
}
"WaterLevelGravity"
{
"windows" "\x3C\x02"
"linux" "\x3C\x02"
}
"CategorizeUnderwater"
{
"windows" "\x73"
"linux" "\x0F\x42"
}

// Client
"ClientMovementUnlock"
Expand Down
2 changes: 1 addition & 1 deletion src/patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ CMemPatch g_CommonPatches[] =
{
CMemPatch("ServerMovementUnlock", "ServerMovementUnlock"),
CMemPatch("VScriptEnable", "VScriptEnable"),
CMemPatch("CheckJumpButtonWater", "FixWaterFloorJump"),
CMemPatch("CategorizeUnderwater", "CategorizeUnderwater"),
CMemPatch("WaterLevelGravity", "WaterLevelGravity"),
};

Expand Down

0 comments on commit c1b6e7c

Please sign in to comment.