mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +00:00
- fixed the bloodspawning completely: It has to check for parent class's states, too, so that inherited blood still works
- made the 'Spray' state in P_SpawnBlood available for all games. SVN r3580 (trunk)
This commit is contained in:
parent
bf48b7620c
commit
a79bcb73ac
2 changed files with 34 additions and 16 deletions
|
@ -232,6 +232,11 @@ struct FActorInfo
|
|||
return FindState(1, &name);
|
||||
}
|
||||
|
||||
bool OwnsState(const FState *state)
|
||||
{
|
||||
return state >= OwnedStates && state < OwnedStates + NumOwnedStates;
|
||||
}
|
||||
|
||||
FActorInfo *GetReplacement (bool lookskill=true);
|
||||
FActorInfo *GetReplacee (bool lookskill=true);
|
||||
|
||||
|
|
|
@ -4658,18 +4658,19 @@ void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, angle_t dir, int damage, AAc
|
|||
th->Translation = TRANSLATION(TRANSLATION_Blood, bloodcolor.a);
|
||||
}
|
||||
|
||||
// Moved out of the blood actor so that replacing blood is easier
|
||||
if (gameinfo.gametype & GAME_DoomStrifeChex)
|
||||
{
|
||||
if (gameinfo.gametype == GAME_Strife)
|
||||
FState *state = th->FindState(NAME_Spray);
|
||||
if (state != NULL)
|
||||
{
|
||||
if (damage > 13)
|
||||
{
|
||||
FState *state = th->FindState(NAME_Spray);
|
||||
if (state != NULL) th->SetState (state);
|
||||
th->SetState (state);
|
||||
}
|
||||
else damage += 2;
|
||||
}
|
||||
|
||||
// Moved out of the blood actor so that replacing blood is easier
|
||||
if (gameinfo.gametype & GAME_DoomStrifeChex)
|
||||
{
|
||||
int advance = 0;
|
||||
if (damage <= 12 && damage >= 9)
|
||||
{
|
||||
|
@ -4679,18 +4680,30 @@ void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, angle_t dir, int damage, AAc
|
|||
{
|
||||
advance = 2;
|
||||
}
|
||||
FActorInfo *ai = th->GetClass()->ActorInfo;
|
||||
|
||||
PClass *cls = th->GetClass();
|
||||
|
||||
while (cls != RUNTIME_CLASS(AActor))
|
||||
{
|
||||
FActorInfo *ai = cls->ActorInfo;
|
||||
if (ai->OwnsState(th->SpawnState))
|
||||
{
|
||||
for (; advance > 0; --advance)
|
||||
{
|
||||
// [RH] Do not set to a state we do not own.
|
||||
if (th->SpawnState + advance < ai->OwnedStates + ai->NumOwnedStates)
|
||||
if (ai->OwnsState(th->SpawnState + advance))
|
||||
{
|
||||
th->SetState(th->SpawnState + advance);
|
||||
break;
|
||||
goto statedone;
|
||||
}
|
||||
}
|
||||
}
|
||||
cls = cls->ParentClass;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
statedone:
|
||||
|
||||
if (bloodtype >= 1)
|
||||
P_DrawSplash2 (40, x, y, z, dir, 2, bloodcolor);
|
||||
|
|
Loading…
Reference in a new issue