- fixed: Classes inherited from PowerScanner didn't work anymore.

SVN r2368 (trunk)
This commit is contained in:
Christoph Oelckers 2010-06-13 10:11:50 +00:00
commit b2cef54d72
3 changed files with 15 additions and 5 deletions

View file

@ -772,7 +772,7 @@ AInventory *AActor::DropInventory (AInventory *item)
//
//============================================================================
AInventory *AActor::FindInventory (const PClass *type)
AInventory *AActor::FindInventory (const PClass *type, bool subclass)
{
AInventory *item;
@ -781,9 +781,19 @@ AInventory *AActor::FindInventory (const PClass *type)
assert (type->ActorInfo != NULL);
for (item = Inventory; item != NULL; item = item->Inventory)
{
if (item->GetClass() == type)
if (!subclass)
{
break;
if (item->GetClass() == type)
{
break;
}
}
else
{
if (item->IsKindOf(type))
{
break;
}
}
}
return item;