Make sure explosive is still valid when updating timer

This commit is contained in:
PabstMirror 2018-09-12 23:07:39 -05:00
parent bbbfabec03
commit f2a57797da

View File

@ -61,6 +61,13 @@ _display displayAddEventHandler ["MouseZChanged", {
[{
params ["_display", "_pfhID"];
// Make sure explosive still exists and is near player
if ((!isNull _display) && {!alive ACE_player} || {!alive GVAR(explosive)} || {(ACE_player distance GVAR(explosive)) > 5}) exitWith {
INFO_2("explosive became invalid",ACE_player,GVAR(explosive));
closeDialog 0;
_pfhID call CBA_fnc_removePerFrameHandler;
};
if (isNull _display) exitWith {
_pfhID call CBA_fnc_removePerFrameHandler;
};