- 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

@ -3226,7 +3226,7 @@ void ModifyDropAmount(AInventory *inv, int dropamount)
if (dropamount > 0)
{
if (flagmask != 0 && inv->IsKindOf(PClass::FindActor(NAME_Ammo)))
if (flagmask != 0 && inv->IsKindOf(NAME_Ammo))
{
inv->Amount = int(dropamount * dropammofactor);
inv->ItemFlags |= IF_IGNORESKILL;
@ -3252,7 +3252,7 @@ void ModifyDropAmount(AInventory *inv, int dropamount)
inv->FloatVar("AmmoFactor") = dropammofactor;
inv->ItemFlags |= flagmask;
}
else if (inv->IsKindOf (RUNTIME_CLASS(AWeapon)))
else if (inv->IsKindOf(NAME_Weapon))
{
// The same goes for ammo from a weapon.
static_cast<AWeapon *>(inv)->AmmoGive1 = int(static_cast<AWeapon *>(inv)->AmmoGive1 * dropammofactor);