mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 15:22:16 +00:00
- 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:
parent
0db79f8dec
commit
b4fa95ab15
2 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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&);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue