diff --git a/source/common/scripting/core/symbols.h b/source/common/scripting/core/symbols.h index 38412c078..cde3855bb 100644 --- a/source/common/scripting/core/symbols.h +++ b/source/common/scripting/core/symbols.h @@ -272,4 +272,4 @@ struct AFuncDesc; struct FieldDesc; AFuncDesc *FindFunction(PContainerType *cls, const char * string); FieldDesc *FindField(PContainerType *cls, const char * string); -void SetImplicitArgs(TArray* args, TArray* argflags, TArray* argnames, PContainerType* cls, uint32_t funcflags, int useflags); +//void SetImplicitArgs(TArray* args, TArray* argflags, TArray* argnames, PContainerType* cls, uint32_t funcflags, int useflags); diff --git a/source/core/thingdef_data.cpp b/source/core/thingdef_data.cpp index 0d0bc6808..ae53ff4dd 100644 --- a/source/core/thingdef_data.cpp +++ b/source/core/thingdef_data.cpp @@ -183,7 +183,7 @@ FFlagDef *FindFlag (const PClass *type, const char *part1, const char *part2, bo if (part2 == NULL) { // Search all lists - int max = strict ? 2 : NUM_FLAG_LISTS; + int max = strict ? 1 : NUM_FLAG_LISTS; for (int i = 0; i < max; ++i) { if ((FlagLists[i].Use & 1) && type->IsDescendantOf (*FlagLists[i].Type)) diff --git a/source/core/zcc_compile_raze.h b/source/core/zcc_compile_raze.h index e23532bee..b088ec577 100644 --- a/source/core/zcc_compile_raze.h +++ b/source/core/zcc_compile_raze.h @@ -1,6 +1,8 @@ #pragma once #include "zcc_compile.h" +class DCoreActor; + void SetImplicitArgs(TArray* args, TArray* argflags, TArray* argnames, PContainerType* cls, uint32_t funcflags, int useflags); class ZCCRazeCompiler : public ZCCCompiler @@ -12,10 +14,6 @@ public: int Compile() override; protected: bool PrepareMetaData(PClass *type) override; - void SetImplicitArgs(TArray* args, TArray* argflags, TArray* argnames, PContainerType* cls, uint32_t funcflags, int useflags) override - { - ::SetImplicitArgs(args, argflags, argnames, cls, funcflags, useflags); - } private: void CompileAllProperties(); bool CompileProperties(PClass *type, TArray &Properties, FName prefix); @@ -25,7 +23,6 @@ private: void ProcessDefaultProperty(PClassActor *cls, ZCC_PropertyStmt *prop, Baggage &bag); void ProcessDefaultFlag(PClassActor *cls, ZCC_FlagStmt *flg); void InitDefaults() override final; - int CheckActionKeyword(ZCC_FuncDeclarator *f, uint32_t &varflags, int useflags, ZCC_StructWork *c); }; diff --git a/source/core/zcompile.cpp b/source/core/zcompile.cpp index 0285d4d85..a8a78c888 100644 --- a/source/core/zcompile.cpp +++ b/source/core/zcompile.cpp @@ -37,13 +37,14 @@ #include "filesystem.h" #include "sc_man.h" #include "zcc_parser.h" -#include "zcc_compile.h" +#include "zcc_compile_raze.h" #include "codegen.h" #include "stats.h" #include "printf.h" #include "dobject.h" -void InitImports(); +void InitThingdef(); +void SynthesizeFlagFields(); void ParseScripts() { @@ -56,7 +57,7 @@ void ParseScripts() auto newns = ParseOneScript(lump, state); PSymbolTable symtable; - ZCCCompiler cc(state, NULL, symtable, newns, lump, state.ParseVersion); + ZCCRazeCompiler cc(state, NULL, symtable, newns, lump, state.ParseVersion); cc.Compile(); if (FScriptPosition::ErrorCounter > 0) @@ -78,7 +79,7 @@ void LoadScripts() cycle_t timer; PType::StaticInit(); - InitImports(); + InitThingdef(); timer.Reset(); timer.Clock(); FScriptPosition::ResetErrorCounter(); @@ -95,6 +96,7 @@ void LoadScripts() timer.Unclock(); if (!batchrun) Printf("script parsing took %.2f ms\n", timer.TimeMS()); + SynthesizeFlagFields(); // Now we may call the scripted OnDestroy method. PClass::bVMOperational = true;