- 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

@ -317,7 +317,7 @@ void cht_DoCheat (player_t *player, int cheat)
case CHT_RESSURECT:
if (player->playerstate != PST_LIVE && player->mo != nullptr)
{
if (player->mo->IsKindOf(PClass::FindActor("PlayerChunk")))
if (player->mo->IsKindOf("PlayerChunk"))
{
Printf("Unable to resurrect. Player is no longer connected to its body.\n");
}
@ -421,7 +421,7 @@ void cht_DoCheat (player_t *player, int cheat)
{
lastinvp = invp;
invp = &(*invp)->Inventory;
if (item->IsKindOf (RUNTIME_CLASS(AWeapon)))
if (item->IsKindOf(NAME_Weapon))
{
AWeapon *weap = static_cast<AWeapon *> (item);
if (!(weap->WeaponFlags & WIF_WIMPY_WEAPON) ||