- fixed crash in AutoUseStrifeHealth

The loop never checked if the item was still valid and would continue to try to use it, even after it was removed from the inventory and destroyed.
As native code this just failed silently, but with the VM it needs to be explicitly checked.
This commit is contained in:
Christoph Oelckers 2018-12-31 19:03:02 +01:00 committed by drfrag
parent 5209d43bf3
commit f1b345dc73

View file

@ -309,7 +309,8 @@ extend class PlayerPawn
while (player.health < 50)
{
if (!UseInventory (Items[index]))
let item = Items[index];
if (item == null || !UseInventory (item))
break;
}
if (player.health >= 50) return;