- 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
parent 31223ca180
commit a6785afddb
28 changed files with 126 additions and 97 deletions

View file

@ -789,7 +789,7 @@ bool AActor::GiveInventory(PClassInventory *type, int amount, bool givecheat)
item->ClearCounters();
if (!givecheat || amount > 0)
{
if (type->IsDescendantOf (PClass::FindActor(NAME_BasicArmorPickup)) || type->IsDescendantOf(PClass::FindActor(NAME_BasicArmorBonus)))
if (type->IsDescendantOf (NAME_BasicArmorPickup) || type->IsDescendantOf(NAME_BasicArmorBonus))
{
item->IntVar(NAME_SaveAmount) *= amount;
}
@ -903,7 +903,7 @@ bool AActor::TakeInventory(PClassActor *itemclass, int amount, bool fromdecorate
// and infinite ammo is on
if (notakeinfinite &&
((dmflags & DF_INFINITE_AMMO) || (player && player->cheats & CF_INFINITEAMMO)) &&
item->IsKindOf(PClass::FindActor(NAME_Ammo)))
item->IsKindOf(NAME_Ammo))
{
// Nothing to do here, except maybe res = false;? Would it make sense?
result = false;