Skip to content

Commit

Permalink
fix crash in SV_MoveEx
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Oct 8, 2024
1 parent 6145a04 commit 2e09f23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fallguys/engine_hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,12 @@ void SV_ClipToLinksEx(areanode_t *node, moveclip_t *clip)

trace_t SV_MoveEx(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type, edict_t *passedict, qboolean monsterClipBrush)
{
moveclip_t clip = { 0 };
moveclip_t clip;
int i;
vec3_t worldEndPoint;
float worldFraction;

//memset(&clip, 0, sizeof(moveclip_t));
memset(&clip, 0, sizeof(moveclip_t));

// clip to world
SV_SingleClipMoveToEntity_10152(g_engfuncs.pfnPEntityOfEntIndex(0), start, mins, maxs, end, &clip.trace, passedict);
Expand Down
7 changes: 5 additions & 2 deletions fallguys/meta_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */,
FILL_FROM_SIGNATURED_CALLER_FROM_END(server, PM_PlaySoundFX_SERVER, -1);
FILL_FROM_SIGNATURED_CALLER_FROM_END(server, CPlayerMove_PlayStepSound, -1);

FILL_FROM_SIGNATURED_CALLER_FROM_START(engine, build_number, 0);

FILL_FROM_SIGNATURE(engine, SV_Physics);
FILL_FROM_SIGNATURE(engine, SV_PushEntity);
FILL_FROM_SIGNATURE(engine, SV_PushMove);
FILL_FROM_SIGNATURE(engine, SV_PushRotate);
FILL_FROM_SIGNATURE(engine, SV_WriteMovevarsToClient);

FILL_FROM_SIGNATURED_CALLER_FROM_START(engine, build_number, 0);

if (g_pfn_build_number() >= 10152)
{
FILL_FROM_SIGNATURED_CALLER_FROM_END(engine, SV_SingleClipMoveToEntity_10152, -1);
Expand Down Expand Up @@ -296,6 +296,7 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */,
if (!g_pfn_build_number)
{
FILL_FROM_SIGNATURE_TY(engine, build_number, i686);

LOG_MESSAGE(PLID, "build_number found at %p!", g_pfn_build_number);

LOG_MESSAGE(PLID, "Current engine build_number = %d!", g_pfn_build_number());
Expand Down Expand Up @@ -524,6 +525,8 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME /* now */,
}
else
{
LOG_MESSAGE(PLID, "Current engine build_number = %d!", g_pfn_build_number());

FILL_FROM_SYMBOL(engine, SV_Physics);
FILL_FROM_SYMBOL(engine, SV_PushEntity);
FILL_FROM_SYMBOL(engine, SV_PushMove);
Expand Down

0 comments on commit 2e09f23

Please sign in to comment.