mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 04:22:34 +00:00
- In P_SetSafeFlash(), check the requested state against every actor when Dehacked moves the
flash to some other class's states instead of just assuming it's good. SVN r4066 (trunk)
This commit is contained in:
parent
8874cb140b
commit
522a940ccf
1 changed files with 8 additions and 4 deletions
|
@ -308,7 +308,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CloseShotgun2)
|
|||
//
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
void P_SetSafeFlash(AWeapon * weapon, player_t * player, FState * flashstate, int index)
|
||||
void P_SetSafeFlash(AWeapon *weapon, player_t *player, FState *flashstate, int index)
|
||||
{
|
||||
|
||||
const PClass * cls = weapon->GetClass();
|
||||
|
@ -337,9 +337,13 @@ void P_SetSafeFlash(AWeapon * weapon, player_t * player, FState * flashstate, in
|
|||
}
|
||||
// if we get here the state doesn't seem to belong to any class in the inheritance chain
|
||||
// This can happen with Dehacked if the flash states are remapped.
|
||||
// The only way to check this would be to go through all Dehacked modifiable actors and
|
||||
// find the correct one.
|
||||
// For now let's assume that it will work.
|
||||
// The only way to check this would be to go through all Dehacked modifiable actors, convert
|
||||
// their states into a single flat array and find the correct one.
|
||||
// Rather than that, just check to make sure it belongs to something.
|
||||
if (FState::StaticFindStateOwner(flashstate + index) == NULL)
|
||||
{ // Invalid state. With no index offset, it should at least be valid.
|
||||
index = 0;
|
||||
}
|
||||
P_SetPsprite (player, ps_flash, flashstate + index);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue