mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-13 07:57:52 +00:00
- 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:
parent
a157e587b5
commit
e51bd95d03
1 changed files with 13 additions and 3 deletions
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue