From aac0de3e48f3d869ed3fce584cab42e68cfb3d0b Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 29 Aug 2013 21:40:01 -0500 Subject: [PATCH] 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. --- src/thingdef/thingdef_codeptr.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 456a1d6e37..ee3e4ee2f0 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -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; }