- optimized the FName versions of IsDescendantOf and IsKindOf. These can be done without first looking up the class type itself.

This commit is contained in:
Christoph Oelckers 2017-02-08 15:47:22 +01:00
commit a6785afddb
28 changed files with 126 additions and 97 deletions

View file

@ -5716,7 +5716,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
if (argCount >= 2)
{
PClassActor *powerupclass = PClass::FindActor(FBehavior::StaticLookupString(args[1]));
if (powerupclass == NULL || !powerupclass->IsDescendantOf(PClass::FindActor(NAME_Powerup)))
if (powerupclass == NULL || !powerupclass->IsDescendantOf(NAME_Powerup))
{
Printf("'%s' is not a type of Powerup.\n", FBehavior::StaticLookupString(args[1]));
return 0;
@ -9042,7 +9042,7 @@ scriptwait:
AInventory *item = activator->FindInventory (dyn_cast<PClassActor>(
PClass::FindClass (FBehavior::StaticLookupString (STACK(1)))));
if (item == NULL || !item->IsKindOf (RUNTIME_CLASS(AWeapon)))
if (item == NULL || !item->IsKindOf(NAME_Weapon))
{
STACK(1) = 0;
}
@ -9110,7 +9110,7 @@ scriptwait:
}
else
{
if (activator != nullptr && activator->IsKindOf(PClass::FindClass("ScriptedMarine")))
if (activator != nullptr && activator->IsKindOf("ScriptedMarine"))
{
SetMarineSprite(activator, type);
}