- Fixed: P_SpawnBlood did not check that the state it was setting for low-damage blood was valid.

SVN r3576 (trunk)
This commit is contained in:
Randy Heit 2012-04-22 02:08:27 +00:00
parent a157e587b5
commit e51bd95d03

View file

@ -4668,15 +4668,25 @@ void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, angle_t dir, int damage, AAc
FState *state = th->FindState(NAME_Spray); FState *state = th->FindState(NAME_Spray);
if (state != NULL) th->SetState (state); if (state != NULL) th->SetState (state);
} }
else damage+=2; else damage += 2;
} }
int advance = 0;
if (damage <= 12 && damage >= 9) if (damage <= 12 && damage >= 9)
{ {
th->SetState (th->SpawnState + 1); advance = 1;
} }
else if (damage < 9) else if (damage < 9)
{ {
th->SetState (th->SpawnState + 2); advance = 2;
}
for (; advance > 0; --advance)
{
// [RH] Do not set to a state we do not own.
if (th->SpawnState + advance < th->GetClass()->ActorInfo->OwnedStates + NumOwnedStates)
{
th->SetState(th->SpawnState + advance);
break;
}
} }
} }
} }