From 3ce25bc348a84c43ae4b15f8c7d8cff908da668b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 6 Sep 2016 08:41:13 +0200 Subject: [PATCH 1/2] - fixed: FxPreIncrDecr depended on undefined compiler behavior. It could only work with right to left function argument processing, but with left to right it failed because the ParseExpressionA call altered sc.TokenType. Note that with register-based arguments on 64 bit platforms this is a very critical issue! --- src/thingdef/thingdef_exp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/thingdef/thingdef_exp.cpp b/src/thingdef/thingdef_exp.cpp index 991e9b947..cad6198f0 100644 --- a/src/thingdef/thingdef_exp.cpp +++ b/src/thingdef/thingdef_exp.cpp @@ -309,7 +309,8 @@ static FxExpression *ParseExpressionC (FScanner &sc, PClassActor *cls) static FxExpression *ParseExpressionB (FScanner &sc, PClassActor *cls) { sc.GetToken(); - switch(sc.TokenType) + int token = sc.TokenType; + switch(token) { case '~': return new FxUnaryNotBitwise(ParseExpressionA (sc, cls)); @@ -325,7 +326,7 @@ static FxExpression *ParseExpressionB (FScanner &sc, PClassActor *cls) case TK_Incr: case TK_Decr: - return new FxPreIncrDecr(ParseExpressionA(sc, cls), sc.TokenType); + return new FxPreIncrDecr(ParseExpressionA(sc, cls), token); default: sc.UnGet(); From 5a3147407ec1c08e29d701061d2436edac40af4b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 6 Sep 2016 22:34:59 +0200 Subject: [PATCH 2/2] - fixed floatification error in A_MaulerTorpedoWave. --- src/g_strife/a_strifeweapons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_strife/a_strifeweapons.cpp b/src/g_strife/a_strifeweapons.cpp index f81ca79f7..0a753e961 100644 --- a/src/g_strife/a_strifeweapons.cpp +++ b/src/g_strife/a_strifeweapons.cpp @@ -552,7 +552,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaulerTorpedoWave) // If the torpedo hit the ceiling, it should still spawn the wave savedz = self->Z(); - if (wavedef && self->ceilingz < wavedef->Top()) + if (wavedef && self->ceilingz < self->Z() + wavedef->height) { self->SetZ(self->ceilingz - wavedef->Height); }