mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
Fixed: Make A_SetTics work with weapons.
- When A_SetTics is called from a weapon, we need to set the tics for the psprite instead of the actor itself.
This commit is contained in:
parent
28e5cc536a
commit
aac0de3e48
1 changed files with 12 additions and 0 deletions
|
@ -4935,6 +4935,18 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTics)
|
|||
ACTION_PARAM_START(1);
|
||||
ACTION_PARAM_INT(tics_to_set, 0);
|
||||
|
||||
if (stateowner != self && self->player != NULL)
|
||||
{ // Is this a weapon? Need to check psp states for a match, then. Blah.
|
||||
for (int i = 0; i < NUMPSPRITES; ++i)
|
||||
{
|
||||
if (self->player->psprites[i].state == CallingState)
|
||||
{
|
||||
self->player->psprites[i].tics = tics_to_set;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Just set tics for self.
|
||||
self->tics = tics_to_set;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue