From 3675492ab42462a8fc1a25f66057c7efe940481b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 7 Feb 2016 11:36:09 +0100 Subject: [PATCH] - fixed DEHACKED code pointer validation for real. The first fix missed a second place where this happened and was incomplete. Anything usable by Dehacked must be VARF_ACTION and VARF_MEMBER in order to work as intended. --- src/d_dehacked.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index b6ae7d0bb..a5a652623 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -2111,7 +2111,7 @@ static int PatchCodePtrs (int dummy) else { TArray &args = sym->Variants[0].ArgFlags; - if (args.Size() != 0 && !(args[0] & VARF_Optional)) + if ((sym->Flags & (VARF_Method | VARF_Action)) != (VARF_Method | VARF_Action) || (args.Size() > 3 && !(args[3] & VARF_Optional))) { Printf("Frame %d: Incompatible code pointer '%s'\n", frame, Line2); sym = NULL; @@ -2723,9 +2723,9 @@ static bool LoadDehSupp () else { TArray &args = sym->Variants[0].ArgFlags; - if (args.Size() > 3 && !(args[3] & VARF_Optional)) + if ((sym->Flags & (VARF_Method|VARF_Action)) != (VARF_Method | VARF_Action) || (args.Size() > 3 && !(args[3] & VARF_Optional))) { - sc.ScriptMessage("Incompatible code pointer '%s' %d, %d", sc.String, args.Size(), args.Size() > 3? args[3] : 0); + sc.ScriptMessage("Incompatible code pointer '%s'", sc.String); } } Actions.Push(sym);