- Applied a modified version of FDARI's patch to prevent giving health to dead things:

* P_GiveBody() now takes a max parameter so that it can also do the bulk of the work
    AHealth::TryPickup() previously did.
  * Setting an actor's health to 0 or below with SetActorProperty will now kill the actor
    properly.

SVN r3438 (trunk)
This commit is contained in:
Randy Heit 2012-03-15 21:21:00 +00:00
commit 977b2caa30
3 changed files with 48 additions and 69 deletions

View file

@ -2874,11 +2874,21 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
switch (property)
{
case APROP_Health:
// Don't alter the health of dead things.
if (actor->health <= 0 || (actor->player != NULL && actor->player->playerstate == PST_DEAD))
{
break;
}
actor->health = value;
if (actor->player != NULL)
{
actor->player->health = value;
}
// If the health is set to a non-positive value, properly kill the actor.
if (value <= 0)
{
actor->Die(activator, activator);
}
break;
case APROP_Speed: