From 701b793f2438bf12e20b848bbaf82c13cbe14852 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 17 Nov 2018 16:21:08 +0100 Subject: [PATCH] - fixed parameter mixup with P_CanResurrect. --- src/p_enemy.cpp | 10 +++++----- src/p_things.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index f49da99836..71dfcf46b9 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -2767,9 +2767,9 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi //========================================================================== // [MC] Code is almost a duplicate of CanCollideWith but with changes to // accommodate checking of just one actor. -bool P_CanResurrect(AActor *tmthing, AActor *thing) +bool P_CanResurrect(AActor *raiser, AActor *thing) { - if (tmthing == nullptr) + if (raiser == nullptr) return false; static unsigned VIndex = ~0u; @@ -2779,12 +2779,12 @@ bool P_CanResurrect(AActor *tmthing, AActor *thing) assert(VIndex != ~0u); } - VMValue params[3] = { tmthing, thing, false }; + VMValue params[3] = { raiser, thing, false }; VMReturn ret; int retval; ret.IntAt(&retval); - auto clss = tmthing->GetClass(); + auto clss = raiser->GetClass(); VMFunction *func = clss->Virtuals.Size() > VIndex ? clss->Virtuals[VIndex] : nullptr; if (func != nullptr) { @@ -2793,7 +2793,7 @@ bool P_CanResurrect(AActor *tmthing, AActor *thing) } // Pointless to be running it again if it's just self. - if (thing == nullptr || thing == tmthing) + if (thing == nullptr || thing == raiser) return true; std::swap(params[0].a, params[1].a); diff --git a/src/p_things.cpp b/src/p_things.cpp index e7de17aab4..0cd046c337 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -463,7 +463,7 @@ bool P_Thing_Raise(AActor *thing, AActor *raiser, int nocheck) return false; } - if (!P_CanResurrect(thing, raiser)) + if (!P_CanResurrect(raiser, thing)) return false; S_Sound (thing, CHAN_BODY, "vile/raise", 1, ATTN_IDLE);