From 67f644c898ee4057036d0fa3f2e8ad491c6f1aa8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 24 Jan 2016 11:50:21 +0100 Subject: [PATCH] - fixed inverted NULL pointer check in A_SetAngle. - let COPY_AAPTR check the most common case AAPTR_DEFAULT first instead of running through all the other cases for it. --- src/actorptrselect.cpp | 2 ++ src/thingdef/thingdef_codeptr.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/actorptrselect.cpp b/src/actorptrselect.cpp index 774067550..54c41e6ba 100644 --- a/src/actorptrselect.cpp +++ b/src/actorptrselect.cpp @@ -32,6 +32,8 @@ AActor *COPY_AAPTR(AActor *origin, int selector) { + if (selector == AAPTR_DEFAULT) return origin; + if (origin) { if (origin->player) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index f61bd2825..ac1afcf49 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -4060,7 +4060,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetAngle) ACTION_PARAM_INT(ptr, 2); AActor *ref = COPY_AAPTR(self, ptr); - if (ref != NULL) + if (ref == NULL) { ACTION_SET_RESULT(false); return;