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:
Randy Heit 2013-08-29 21:40:01 -05:00
parent 28e5cc536a
commit aac0de3e48

View file

@ -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;
}