Fixed potential crash on usage of Mystic Ambit Incant

https://forum.zdoom.org/viewtopic.php?t=60080
This commit is contained in:
alexey.lysiuk 2018-04-03 12:41:51 +03:00
parent 9da92facda
commit d3cacbf246

View file

@ -35,8 +35,13 @@ class ArtiHealingRadius : Inventory
for (int i = 0; i < MAXPLAYERS; ++i) for (int i = 0; i < MAXPLAYERS; ++i)
{ {
if (!playeringame[i])
{
continue;
}
PlayerPawn mo = players[i].mo; PlayerPawn mo = players[i].mo;
if (playeringame[i] && mo != null && mo.health > 0 && mo.Distance2D (Owner) <= HEAL_RADIUS_DIST) if (mo != null && mo.health > 0 && mo.Distance2D (Owner) <= HEAL_RADIUS_DIST)
{ {
// Q: Is it worth it to make this selectable as a player property? // Q: Is it worth it to make this selectable as a player property?
// A: Probably not - but it sure doesn't hurt. // A: Probably not - but it sure doesn't hurt.