From 3ab94871a31490864b01207dcb87697473c3f61b Mon Sep 17 00:00:00 2001 From: vbawol Date: Sat, 25 Feb 2017 16:36:14 -0600 Subject: [PATCH] fixed incorrect usage for setFSMvar on sappers set local var on unit to get FSM ref --- Sources/epoch_code/compile/EPOCH_unitSpawn.sqf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf b/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf index ba6f8dca..f81154fe 100644 --- a/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf +++ b/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf @@ -85,8 +85,9 @@ switch _unitClass do { _bomb attachTo [_unit, [0,0,0],"Pelvis"]; _unit call _disableAI; _sapperHndl = [_unit, _bomb, _trgt] execFSM "\x\addons\a3_epoch_code\System\Sapper_Brain.fsm"; - _unit addEventHandler ["FiredNear", "(_this select 0) setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];"]; - _unit addEventHandler ["Hit", "(_this select 0) setFSMVariable [""_sHit"",[_this select 1, _this select 2]];"]; + _unit setVariable ["sapperHndl",_sapperHndl]; + _unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]]; + _unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]]; }; }; case "Epoch_SapperB_F": { @@ -96,8 +97,9 @@ switch _unitClass do { _bomb attachTo[_unit, [0, 0, 0], "Pelvis"]; _unit call _disableAI; _sapperHndl = [_unit, _bomb, _trgt] execFSM "\x\addons\a3_epoch_code\System\Sapper_Brain2.fsm"; - _unit addEventHandler ["FiredNear", "(_this select 0) setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];"]; - _unit addEventHandler ["Hit", "(_this select 0) setFSMVariable [""_sHit"",[_this select 1, _this select 2]];"]; + _unit setVariable ["sapperHndl",_sapperHndl]; + _unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]]; + _unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]]; }; case "I_UAV_01_F": { _targetPos = getPosATL _trgt;