- replaced more dyn_casts and checks for RUNTIME_CLASS(PClassActor)

It is preferable to use IsDescendantOf wherever possible if we ever want to be able to separate PClass from PType.
This commit is contained in:
Christoph Oelckers 2017-04-12 10:20:58 +02:00
commit 9c9b2ccf6d
13 changed files with 28 additions and 23 deletions

View file

@ -1385,7 +1385,7 @@ void ZCCCompiler::CompileAllProperties()
bool ZCCCompiler::CompileProperties(PClass *type, TArray<ZCC_Property *> &Properties, FName prefix)
{
if (!type->IsKindOf(RUNTIME_CLASS(PClassActor)))
if (!type->IsDescendantOf(RUNTIME_CLASS(AActor)))
{
Error(Properties[0], "Properties can only be defined for actors");
return false;
@ -2850,7 +2850,7 @@ void ZCCCompiler::CompileStates()
FString statename; // The state builder wants the label as one complete string, not separated into tokens.
FStateDefinitions statedef;
statedef.MakeStateDefines(dyn_cast<PClassActor>(c->Type()->ParentClass));
statedef.MakeStateDefines(ValidateActor(c->Type()->ParentClass));
int numframes = 0;
for (auto s : c->States)