diff --git a/src/Components/Modules/Elevators.cpp b/src/Components/Modules/Elevators.cpp index 08dffeb7..6507f1f2 100644 --- a/src/Components/Modules/Elevators.cpp +++ b/src/Components/Modules/Elevators.cpp @@ -16,9 +16,9 @@ namespace Components const auto elevatorSetting = Elevators::BG_Elevators.get(); while (true) { - point[0] = ps->origin[0] + Game::CorrectSolidDeltas[i][0]; - point[1] = ps->origin[1] + Game::CorrectSolidDeltas[i][1]; - point[2] = ps->origin[2] + Game::CorrectSolidDeltas[i][2]; + point[0] = ps->origin[0] + (*Game::CorrectSolidDeltas)[i][0]; + point[1] = ps->origin[1] + (*Game::CorrectSolidDeltas)[i][1]; + point[2] = ps->origin[2] + (*Game::CorrectSolidDeltas)[i][2]; Game::PM_playerTrace(pm, trace, point, point, &pm->bounds, ps->clientNum, pm->tracemask); @@ -40,8 +40,8 @@ namespace Components } } - i += 1; - if (i >= 26) + ++i; + if (i >= 26) // CorrectSolidDeltas count { ps->groundEntityNum = Game::ENTITYNUM_NONE; pml->groundPlane = 0; @@ -62,15 +62,15 @@ namespace Components return 1; } - void Elevators::PM_Trace_Hk(Game::pmove_s* pm, Game::trace_t* trace, const float* f3, - const float* f4, const Game::Bounds* bounds, int a6, int a7) + void Elevators::PM_Trace_Hk(Game::pmove_s* pm, Game::trace_t* results, const float* start, + const float* end, const Game::Bounds* bounds, int passEntityNum, int contentMask) { - Game::PM_Trace(pm, trace, f3, f4, bounds, a6, a7); + Game::PM_Trace(pm, results, start, end, bounds, passEntityNum, contentMask); // Allow the player to stand even when there is no headroom if (Elevators::BG_Elevators.get() == Elevators::EASY) { - trace->allsolid = false; + results->allsolid = false; } } @@ -111,8 +111,7 @@ namespace Components Elevators::ENABLED, Game::DVAR_CODINFO, "Elevators glitch settings"); }); - //Replace PM_CorrectAllSolid - Utils::Hook(0x57369E, Elevators::PM_CorrectAllSolidStub, HOOK_CALL).install()->quick(); + Utils::Hook(0x57369E, Elevators::PM_CorrectAllSolidStub, HOOK_CALL).install()->quick(); // PM_GroundTrace // Place hooks in PM_CheckDuck. If the elevators dvar is set to easy the // flags for duck/prone will always be removed from the player state diff --git a/src/Game/Functions.cpp b/src/Game/Functions.cpp index 4dab19e6..3edcc68a 100644 --- a/src/Game/Functions.cpp +++ b/src/Game/Functions.cpp @@ -547,11 +547,11 @@ namespace Game FastCriticalSection* db_hashCritSect = reinterpret_cast(0x16B8A54); - vec3_t* CorrectSolidDeltas = reinterpret_cast(0x739BB8); // Count 26 + float (*CorrectSolidDeltas)[26][3] = reinterpret_cast(0x739BB8); // Count 26 level_locals_t* level = reinterpret_cast(0x1A831A8); - float(*penetrationDepthTable)[PENETRATE_TYPE_COUNT][SURF_TYPE_COUNT] = reinterpret_cast(0x7C4878); + float (*penetrationDepthTable)[PENETRATE_TYPE_COUNT][SURF_TYPE_COUNT] = reinterpret_cast(0x7C4878); WinMouseVars_t* s_wmv = reinterpret_cast(0x649D640); diff --git a/src/Game/Functions.hpp b/src/Game/Functions.hpp index a03f0c85..e6840329 100644 --- a/src/Game/Functions.hpp +++ b/src/Game/Functions.hpp @@ -999,10 +999,10 @@ namespace Game typedef void(__cdecl * Jump_ClearState_t)(playerState_s* ps); extern Jump_ClearState_t Jump_ClearState; - typedef void(__cdecl * PM_playerTrace_t)(pmove_s*, trace_t*, const float*, const float*, const Bounds*, int, int); + typedef void(__cdecl * PM_playerTrace_t)(pmove_s* pm, trace_t* results, const float* start, const float* end, const Bounds* bounds, int passEntityNum, int contentMask); extern PM_playerTrace_t PM_playerTrace; - typedef void(__cdecl * PM_Trace_t)(pmove_s*, trace_t*, const float*, const float*, const Bounds*, int, int); + typedef void(__cdecl * PM_Trace_t)(pmove_s* pm, trace_t* results, const float* start, const float* end, const Bounds* bounds, int passEntityNum, int contentMask); extern PM_Trace_t PM_Trace; typedef EffectiveStance(__cdecl * PM_GetEffectiveStance_t)(const playerState_s* ps); @@ -1145,13 +1145,13 @@ namespace Game constexpr auto MAX_MODELS = 512; extern XModel** cached_models; - extern vec3_t* CorrectSolidDeltas; + extern float (*CorrectSolidDeltas)[26][3]; extern FastCriticalSection* db_hashCritSect; extern level_locals_t* level; - extern float(*penetrationDepthTable)[PENETRATE_TYPE_COUNT][SURF_TYPE_COUNT]; + extern float (*penetrationDepthTable)[PENETRATE_TYPE_COUNT][SURF_TYPE_COUNT]; extern WinMouseVars_t* s_wmv;