Skip to content

Commit

Permalink
Make sure explosive is still valid when updating timer
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed Sep 13, 2018
1 parent bbbfabe commit f2a5779
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions addons/explosives/functions/fnc_openTimerUI.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit f2a5779

Please sign in to comment.