- handle state label resolution in a non-actor cpntext more gracefully.

Note that this is merely a hotfix. Properly handling this to allow universal use of state scopes will require more work in cases where a scoped state is being accessed through a non-self pointer.
This commit is contained in:
Christoph Oelckers 2017-08-12 10:04:06 +02:00
parent 0db79f8dec
commit b4fa95ab15
2 changed files with 5 additions and 5 deletions

View file

@ -11101,7 +11101,7 @@ ExpEmit FxRuntimeStateIndex::Emit(VMFunctionBuilder *build)
//
//==========================================================================
FxMultiNameState::FxMultiNameState(const char *_statestring, const FScriptPosition &pos)
FxMultiNameState::FxMultiNameState(const char *_statestring, const FScriptPosition &pos, PClassActor *checkclass)
:FxExpression(EFX_MultiNameState, pos)
{
FName scopename;
@ -11119,7 +11119,7 @@ FxMultiNameState::FxMultiNameState(const char *_statestring, const FScriptPositi
}
names = MakeStateNameList(statestring);
names.Insert(0, scopename);
scope = nullptr;
scope = checkclass;
}
//==========================================================================
@ -11135,8 +11135,8 @@ FxExpression *FxMultiNameState::Resolve(FCompileContext &ctx)
int symlabel;
auto vclass = PType::toClass(ctx.Class);
assert(vclass != nullptr);
auto clstype = ValidateActor(vclass->Descriptor);
//assert(vclass != nullptr);
auto clstype = vclass == nullptr? nullptr : ValidateActor(vclass->Descriptor);
if (names[0] == NAME_None)
{

View file

@ -2089,7 +2089,7 @@ class FxMultiNameState : public FxExpression
TArray<FName> names;
public:
FxMultiNameState(const char *statestring, const FScriptPosition &pos);
FxMultiNameState(const char *statestring, const FScriptPosition &pos, PClassActor *checkclass = nullptr);
FxExpression *Resolve(FCompileContext&);
};