Ensure the condition of the action is always checked uncached before calling the statement.

This commit is contained in:
Nicolás Badano 2015-03-21 20:30:27 -03:00
parent 87b1458dc0
commit 2beb1a289e
4 changed files with 31 additions and 5 deletions

View File

@ -30,7 +30,6 @@ GVAR(lastTime) = diag_tickTime;
GVAR(rotationAngle) = 0;
GVAR(selectedAction) = [[],[]];
GVAR(selectedStatement) = {};
GVAR(actionSelected) = false;
GVAR(selectedTarget) = objNull;

View File

@ -14,9 +14,19 @@
if(GVAR(actionSelected)) then {
this = GVAR(selectedTarget);
private ["_player","_target","_actionData"];
_player = ACE_Player;
_target = GVAR(selectedTarget);
[GVAR(selectedTarget), ACE_player, (GVAR(selectedAction) select 0) select 6] call GVAR(selectedStatement);
// Clear the conditions caches
["clearConditionCaches", []] call EFUNC(common,localEvent);
// Check the action conditions
_actionData = GVAR(selectedAction) select 0;
if ([_target, _player, _actionData select 6] call (_actionData select 4)) then {
[_target, _player, _actionData select 6] call (_actionData select 3);
};
};
if (GVAR(keyDown)) then {

View File

@ -18,9 +18,19 @@ if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then {
if(GVAR(actionSelected)) then {
this = GVAR(selectedTarget);
private ["_player","_target","_actionData"];
_player = ACE_Player;
_target = GVAR(selectedTarget);
[GVAR(selectedTarget), ACE_player, (GVAR(selectedAction) select 0) select 6] call GVAR(selectedStatement);
// Clear the conditions caches
["clearConditionCaches", []] call EFUNC(common,localEvent);
// Check the action conditions
_actionData = GVAR(selectedAction) select 0;
if ([_target, _player, _actionData select 6] call (_actionData select 4)) then {
[_target, _player, _actionData select 6] call (_actionData select 3);
};
};
if (GVAR(keyDownSelfAction)) then {

View File

@ -144,7 +144,6 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then {
GVAR(actionSelected) = true;
GVAR(selectedAction) = (_closest select 0) select 1;
GVAR(selectedTarget) = (GVAR(selectedAction)) select 2;
GVAR(selectedStatement) = ((GVAR(selectedAction)) select 0) select 3;
_misMatch = false;
_hoverPath = (_closest select 2);
@ -180,7 +179,15 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then {
this = GVAR(selectedTarget);
_player = ACE_Player;
_target = GVAR(selectedTarget);
[GVAR(selectedTarget), ACE_player, (GVAR(selectedAction) select 0) select 6] call GVAR(selectedStatement);
// Clear the conditions caches
["clearConditionCaches", []] call EFUNC(common,localEvent);
// Check the action conditions
_actionData = GVAR(selectedAction) select 0;
if ([_target, _player, _actionData select 6] call (_actionData select 4)) then {
[_target, _player, _actionData select 6] call (_actionData select 3);
};
};
};
};