- Fixed issues with invalid GetMaxInventory calls.

This commit is contained in:
Edoardo Prezioso 2016-05-18 09:37:00 +02:00 committed by Christoph Oelckers
parent 44f09edf4c
commit 243030046a

View file

@ -1328,6 +1328,18 @@ static int CheckInventory (AActor *activator, const char *type, bool max)
} }
PClassActor *info = PClass::FindActor (type); PClassActor *info = PClass::FindActor (type);
if (info == NULL)
{
Printf ("ACS: I don't know what '%s' is.\n", type);
return 0;
}
else if (!info->IsDescendantOf(RUNTIME_CLASS(AInventory)))
{
Printf ("ACS: '%s' is not an inventory item.\n", type);
return 0;
}
AInventory *item = activator->FindInventory (info); AInventory *item = activator->FindInventory (info);
if (max) if (max)