mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
- fixed skip_super application fro ZScript.
The order of processing is different here so when the property gets parsed there are no states to delete. To fix this the property just flags the class and lets the ZScript state compiler deal with this as needed.
This commit is contained in:
parent
56df88c792
commit
425f1408f7
3 changed files with 16 additions and 3 deletions
|
@ -244,6 +244,7 @@ struct FActorInfo
|
|||
PClassActor *Replacee = nullptr;
|
||||
FState *OwnedStates = nullptr;
|
||||
int NumOwnedStates = 0;
|
||||
bool SkipSuperSet = false;
|
||||
uint8_t GameFilter = GAME_Any;
|
||||
uint16_t SpawnID = 0;
|
||||
uint16_t ConversationID = 0;
|
||||
|
@ -287,7 +288,7 @@ struct FActorInfo
|
|||
};
|
||||
|
||||
// This is now merely a wrapper that adds actor-specific functionality to PClass.
|
||||
// No objects of this type will be created ever - its only use is to static_casr
|
||||
// No objects of this type will be created ever - its only use is to static_cast
|
||||
// PClass to it.
|
||||
class PClassActor : public PClass
|
||||
{
|
||||
|
|
|
@ -540,7 +540,7 @@ DEFINE_PROPERTY(skip_super, 0, Actor)
|
|||
if (info->Size != actorclass->Size)
|
||||
{
|
||||
bag.ScriptPosition.Message(MSG_OPTERROR,
|
||||
"'skip_super' is only allowed in subclasses of AActor with no additional fields and will be ignored in type %s.", info->TypeName.GetChars());
|
||||
"'skip_super' is only allowed in subclasses of Actor with no additional fields and will be ignored in type %s.", info->TypeName.GetChars());
|
||||
return;
|
||||
}
|
||||
if (bag.StateSet)
|
||||
|
@ -552,6 +552,7 @@ DEFINE_PROPERTY(skip_super, 0, Actor)
|
|||
|
||||
*defaults = *GetDefault<AActor>();
|
||||
ResetBaggage (&bag, RUNTIME_CLASS(AActor));
|
||||
static_cast<PClassActor*>(bag.Info)->ActorInfo()->SkipSuperSet = true; // ZScript processes the states later so this property must be flagged for later handling.
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -2872,7 +2872,18 @@ void ZCCCompiler::CompileStates()
|
|||
|
||||
FString statename; // The state builder wants the label as one complete string, not separated into tokens.
|
||||
FStateDefinitions statedef;
|
||||
statedef.MakeStateDefines(ValidateActor(c->ClassType()->ParentClass));
|
||||
|
||||
if (static_cast<PClassActor*>(c->ClassType())->ActorInfo()->SkipSuperSet)
|
||||
{
|
||||
// SKIP_SUPER'ed actors only get the base states from AActor.
|
||||
statedef.MakeStateDefines(RUNTIME_CLASS(AActor));
|
||||
}
|
||||
else
|
||||
{
|
||||
statedef.MakeStateDefines(ValidateActor(c->ClassType()->ParentClass));
|
||||
}
|
||||
|
||||
|
||||
int numframes = 0;
|
||||
|
||||
for (auto s : c->States)
|
||||
|
|
Loading…
Reference in a new issue