- consolidated the check for "is actor an owned inventory item" into a subfunction.

This check occured 9 times in the source, better have it only once.
This commit is contained in:
Christoph Oelckers 2018-12-02 16:53:12 +01:00
commit 319f8743db
8 changed files with 20 additions and 32 deletions

View file

@ -914,10 +914,7 @@ static bool IsActorACountItem(AActor *mo)
// [SP] for all actors
static bool IsActor(AActor *mo)
{
if (mo->IsKindOf(RUNTIME_CLASS(AInventory)))
return static_cast<AInventory *>(mo)->Owner == NULL; // [SP] Exclude inventory-owned items
else
return true;
return mo->IsMapActor();
}
// [SP] modified - now allows showing count only, new arg must be passed. Also now still counts regardless, if lists are printed.