From 42c6245a509cd25f2c56742dbd8c2c26656148da Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 17 Feb 2016 11:42:45 +0100 Subject: [PATCH] - restored A_CountdownArg to what it looked like before the scripting branch. The new version did not work as expected anymore. --- src/thingdef/thingdef_codeptr.cpp | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 4b9bb77de..fa2a336d4 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -3269,35 +3269,29 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIf) // A_CountdownArg // //=========================================================================== + DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CountdownArg) { PARAM_ACTION_PROLOGUE; - PARAM_INT(argnum); - PARAM_STATE_OPT(state) { state = self->FindState(NAME_Death); } + PARAM_INT(cnt); + PARAM_STATE_OPT(state) { state = self->FindState(NAME_Death); } - if (argnum >= 0 && argnum < (int)countof(self->args)) + if (cnt<0 || cnt >= 5) return; + if (!self->args[cnt]--) { - if (!self->args[argnum]--) + if (self->flags&MF_MISSILE) { - if (self->flags & MF_MISSILE) - { - P_ExplodeMissile(self, NULL, NULL); - } - else if (self->flags & MF_SHOOTABLE) - { - P_DamageMobj(self, NULL, NULL, self->health, NAME_None, DMG_FORCED); - } - else - { - self->SetState(self->FindState(NAME_Death)); - } + P_ExplodeMissile(self, NULL, NULL); + } + else if (self->flags&MF_SHOOTABLE) + { + P_DamageMobj(self, NULL, NULL, self->health, NAME_None, DMG_FORCED); } else { self->SetState(state); } } - return 0; } //============================================================================