mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 15:02:39 +00:00
- fixed parameter mixup with P_CanResurrect.
This commit is contained in:
parent
160f17a907
commit
701b793f24
2 changed files with 6 additions and 6 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue