diff --git a/src/p_acs.cpp b/src/p_acs.cpp index d66d0f8f8..2de959be6 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -1328,6 +1328,18 @@ static int CheckInventory (AActor *activator, const char *type, bool max) } 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); if (max)