- fix handling of the global script in FraggleScript.

Depending on serialization order is not a good idea here, so now it's no longer stored as a parent in the main level script but explicitly checked for when looking for a variable.
This commit is contained in:
Christoph Oelckers 2019-01-27 21:03:25 +01:00
commit 11c453a71f
5 changed files with 25 additions and 22 deletions

View file

@ -34,7 +34,7 @@
#include <stdarg.h>
#include "t_script.h"
#include "v_text.h"
#include "g_levellocals.h"""
CVAR(Bool, script_debug, false, 0)
@ -561,7 +561,7 @@ void FParser::SimpleEvaluate(svalue_t &returnvar, int n)
break;
case name_:
var = Script->FindVariable(Tokens[n]);
var = Script->FindVariable(Tokens[n], Level->FraggleScriptThinker->GlobalScript);
if(!var)
{
script_error("unknown variable '%s'\n", Tokens[n]);