mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-24 21:11:52 +00:00
- fix some issues with ClearInventory() that sometimes caused script errors
This commit is contained in:
parent
4c27b55eb9
commit
41c69736b1
2 changed files with 7 additions and 6 deletions
|
@ -940,6 +940,7 @@ class Inventory : Actor
|
|||
}
|
||||
else
|
||||
{
|
||||
Owner = null;
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -333,8 +333,13 @@ extend class Actor
|
|||
// destroy something we already processed, we've already destroyed it,
|
||||
// so it won't have anything to destroy.
|
||||
|
||||
let last = self;
|
||||
if (player != null)
|
||||
{
|
||||
player.ReadyWeapon = null;
|
||||
player.PendingWeapon = WP_NOCHANGE;
|
||||
}
|
||||
|
||||
let last = self;
|
||||
while (last.inv != NULL)
|
||||
{
|
||||
let inv = last.inv;
|
||||
|
@ -348,11 +353,6 @@ extend class Actor
|
|||
last = inv;
|
||||
}
|
||||
}
|
||||
if (player != null)
|
||||
{
|
||||
player.ReadyWeapon = null;
|
||||
player.PendingWeapon = WP_NOCHANGE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue