From 2e5c3492fd91e5538b7b6b124ba00a001bded76e Mon Sep 17 00:00:00 2001 From: WPMGPRoSToTeMa Date: Tue, 2 Aug 2016 19:43:45 +0300 Subject: [PATCH] Additional checks for FL_KILLME flag before callbacks (OnTouch and OnThink) --- rehlds/engine/sv_phys.cpp | 11 ++++++++++- rehlds/engine/world.cpp | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/rehlds/engine/sv_phys.cpp b/rehlds/engine/sv_phys.cpp index 688c1cb..953d4e5 100644 --- a/rehlds/engine/sv_phys.cpp +++ b/rehlds/engine/sv_phys.cpp @@ -176,6 +176,11 @@ void SV_Impact(edict_t *e1, edict_t *e2, trace_t *ptrace) { SV_SetGlobalTrace(ptrace); gEntityInterface.pfnTouch(e1, e2); + +#ifdef REHLDS_FIXES + if ((e1->v.flags & FL_KILLME) || (e2->v.flags & FL_KILLME)) + return; +#endif // REHLDS_FIXES } if (e2->v.solid) { @@ -784,7 +789,11 @@ void SV_Physics_Pusher(edict_t *ent) ent->v.angles[i] = fmod(ent->v.angles[i], 3600.0f); } - if (thinktime > oldltime && ((ent->v.flags & FL_ALWAYSTHINK) || thinktime <= ent->v.ltime)) + if (thinktime > oldltime && ((ent->v.flags & FL_ALWAYSTHINK) || thinktime <= ent->v.ltime) +#ifdef REHLDS_FIXES + && !(ent->v.flags & FL_KILLME) +#endif // REHLDS_FIXES + ) { ent->v.nextthink = 0; gGlobalVariables.time = (float) g_psv.time; diff --git a/rehlds/engine/world.cpp b/rehlds/engine/world.cpp index 3e0b288..4ff8de7 100644 --- a/rehlds/engine/world.cpp +++ b/rehlds/engine/world.cpp @@ -349,6 +349,11 @@ void SV_TouchLinks(edict_t *ent, areanode_t *node) } } +#ifdef REHLDS_FIXES + if ((ent->v.flags & FL_KILLME) || (touch->v.flags & FL_KILLME)) + continue; +#endif // REHLDS_FIXES + if (touch->v.solid == SOLID_TRIGGER && ent->v.absmin[0] <= touch->v.absmax[0] && ent->v.absmin[1] <= touch->v.absmax[1]