From 68b47d81de98ec3674f1fa8f7d642b9cd3e86b32 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Feb 2017 17:58:54 +0100 Subject: [PATCH] - fixed WP_NOCHANGE changes with a restart, so this must be taken into account for the script variable holding it. --- src/scripting/thingdef_data.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index 0f5647005..378c6c927 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -65,6 +65,7 @@ static TArray AFTable; static TArray FieldTable; extern int BackbuttonTime; extern float BackbuttonAlpha; +static AWeapon *wpnochg; //========================================================================== // @@ -924,7 +925,7 @@ void InitThingdef() // Argh. It sucks when bad hacks need to be supported. WP_NOCHANGE is just a bogus pointer but it used everywhere as a special flag. // It cannot be defined as constant because constants can either be numbers or strings but nothing else, so the only 'solution' // is to create a static variable from it and reference that in the script. Yuck!!! - static AWeapon *wpnochg = WP_NOCHANGE; + wpnochg = WP_NOCHANGE; fieldptr = new PField("WP_NOCHANGE", NewPointer(RUNTIME_CLASS(AWeapon), false), VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&wpnochg); Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr);