mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-04-22 08:28:53 +00:00
Merge pull request #555 from alexey-lysiuk/non_giveinv_crash
Fixed crash on attempt to give non-inventory actor
This commit is contained in:
commit
b284a7e0b3
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue