- swapped order of checks for picking up an item.

Failure must take precedence over the morph check because this does not return a proper toucher.
This commit is contained in:
Christoph Oelckers 2019-01-23 00:14:27 +01:00 committed by drfrag
parent 242f1458c8
commit 9402929209

View file

@ -1887,17 +1887,17 @@ class PlayerPawn : Actor
bool res;
Actor check;
[res, check] = item.CallTryPickup(self);
if (check != self)
if (!res)
{
item.Destroy();
item = NULL;
}
else if (check != self)
{
// Player was morphed. This is illegal at game start.
// This problem is only detectable when it's too late to do something about it...
ThrowAbortException("Cannot give morph item '%s' when starting a game!", di.Name);
}
else if (!res)
{
item.Destroy();
item = NULL;
}
}
let weap = Weapon(item);
if (weap != NULL && weap.CheckAmmo(Weapon.EitherFire, false))