From caf2ca0df7adba708f47ce231d2bd3aad8788c42 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 4 Mar 2016 15:11:20 +0100 Subject: [PATCH] - fixed: CallStateChain must never allow a jumping function to set the chain's overall result to successful. --- src/thingdef/thingdef_codeptr.cpp | 1 + src/thingdef/thingdef_expression.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 98dd60f2de..db1f722f1d 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -146,6 +146,7 @@ bool ACustomInventory::CallStateChain (AActor *actor, FState *state) if (proto->ReturnTypes[0] == TypeState) { // Function returns a state wantret = &ret[0]; + retval = false; // this is a jump function which never affects the success state. } else if (proto->ReturnTypes[0] == TypeSInt32 || proto->ReturnTypes[0] == TypeBool) { // Function returns an int or bool diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index 8239f0e475..7ecc3c3c47 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -3220,7 +3220,7 @@ FxExpression *FxActionSpecialCall::Resolve(FCompileContext& ctx) int DecoCallLineSpecial(VMFrameStack *stack, VMValue *param, int numparam, VMReturn *ret, int numret) { - assert(numparam > 2 && numparam < 7); + assert(numparam > 2 && numparam < 8); assert(numret == 1); assert(param[0].Type == REGT_INT); assert(param[1].Type == REGT_POINTER);