From d3cacbf246293197d67602cbd88003980d614ef2 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 3 Apr 2018 12:41:51 +0300 Subject: [PATCH] Fixed potential crash on usage of Mystic Ambit Incant https://forum.zdoom.org/viewtopic.php?t=60080 --- wadsrc/static/zscript/hexen/healingradius.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wadsrc/static/zscript/hexen/healingradius.txt b/wadsrc/static/zscript/hexen/healingradius.txt index 52b87c15b..95540bd6c 100644 --- a/wadsrc/static/zscript/hexen/healingradius.txt +++ b/wadsrc/static/zscript/hexen/healingradius.txt @@ -35,8 +35,13 @@ class ArtiHealingRadius : Inventory for (int i = 0; i < MAXPLAYERS; ++i) { + if (!playeringame[i]) + { + continue; + } + 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? // A: Probably not - but it sure doesn't hurt.