mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-05-31 09:21:36 +00:00
- moved OwnedStates and NumOwnedStates out of PClassActor.
This commit is contained in:
parent
05240ccbe5
commit
4afe2d4218
11 changed files with 37 additions and 41 deletions
|
@ -10838,16 +10838,16 @@ FxExpression *FxStateByIndex::Resolve(FCompileContext &ctx)
|
|||
auto aclass = dyn_cast<PClassActor>(ctx.Class);
|
||||
|
||||
// This expression type can only be used from actors, for everything else it has already produced a compile error.
|
||||
assert(aclass != nullptr && aclass->NumOwnedStates > 0);
|
||||
assert(aclass != nullptr && aclass->ActorInfo()->NumOwnedStates > 0);
|
||||
|
||||
if (aclass->NumOwnedStates <= index)
|
||||
if (aclass->ActorInfo()->NumOwnedStates <= index)
|
||||
{
|
||||
ScriptPosition.Message(MSG_ERROR, "%s: Attempt to jump to non existing state index %d",
|
||||
ctx.Class->TypeName.GetChars(), index);
|
||||
delete this;
|
||||
return nullptr;
|
||||
}
|
||||
int symlabel = StateLabels.AddPointer(aclass->OwnedStates + index);
|
||||
int symlabel = StateLabels.AddPointer(aclass->ActorInfo()->OwnedStates + index);
|
||||
FxExpression *x = new FxConstant(symlabel, ScriptPosition);
|
||||
x->ValueType = TypeStateLabel;
|
||||
delete this;
|
||||
|
@ -10912,8 +10912,8 @@ FxExpression *FxRuntimeStateIndex::Resolve(FCompileContext &ctx)
|
|||
SAFE_RESOLVE(Index, ctx);
|
||||
}
|
||||
auto aclass = dyn_cast<PClassActor>(ctx.Class);
|
||||
assert(aclass != nullptr && aclass->NumOwnedStates > 0);
|
||||
symlabel = StateLabels.AddPointer(aclass->OwnedStates + ctx.StateIndex);
|
||||
assert(aclass != nullptr && aclass->ActorInfo()->NumOwnedStates > 0);
|
||||
symlabel = StateLabels.AddPointer(aclass->ActorInfo()->OwnedStates + ctx.StateIndex);
|
||||
ValueType = TypeStateLabel;
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue