Merge pull request #555 from alexey-lysiuk/non_giveinv_crash

Fixed crash on attempt to give non-inventory actor
This commit is contained in:
coelckers 2016-02-09 10:20:03 +01:00
commit b284a7e0b3

View file

@ -1711,6 +1711,12 @@ static void DoGiveInventory(AActor * receiver, bool use_aaptr, DECLARE_PARAMINFO
if (amount==0) amount=1;
if (mi)
{
if (!mi->IsDescendantOf (RUNTIME_CLASS(AInventory)))
{
ACTION_SET_RESULT(false);
return;
}
AInventory *item = static_cast<AInventory *>(Spawn (mi, 0, 0, 0, NO_REPLACE));
if (!item)
{