- fixed: Classes inherited from PowerScanner didn't work anymore.
SVN r2368 (trunk)
This commit is contained in:
parent
ec44397881
commit
b2cef54d72
3 changed files with 15 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue