- added missing NULL pointer check to ACS's CheckInventory.

This commit is contained in:
Christoph Oelckers 2016-05-18 09:39:19 +02:00
parent fe966916d7
commit 661c2e5919

View file

@ -1333,10 +1333,14 @@ static int CheckInventory (AActor *activator, const char *type, bool max)
if (max)
{
if (item)
{
return item->MaxAmount;
else
}
else if (info != nullptr && info->IsDescendantOf(RUNTIME_CLASS(AInventory)))
{
return ((AInventory *)GetDefaultByType(info))->MaxAmount;
}
}
return item ? item->Amount : 0;
}