stop passing copies of lzList around, it will not change

This commit is contained in:
Eero af Heurlin 2016-07-24 16:43:08 +03:00
parent ad471edf9e
commit 1365770430
4 changed files with 5 additions and 8 deletions

View File

@ -5,7 +5,6 @@ waitUntil {!(isNil "missionInitComplete")};
_target = _this select 0;
_lzLocs = _this select 1;
_prevLZ = _this select 2;
_playerno = _this select 3;
_player = playersArray select _playerno;
@ -13,7 +12,7 @@ _player = playersArray select _playerno;
if (!!(taskIdsArray select _playerno)) exitWith { diag_log format["createObj: Task %1 already exists for %2", (taskIdsArray select _playerno), _playerno] };
_lzLoc = (_lzLocs - [_prevLZ]) call BIS_fnc_SelectRandom;
_lzLoc = (lzList - [_prevLZ]) call BIS_fnc_SelectRandom;
_taskid = format["p%1_lz%2", _playerno, _lzLoc];
@ -25,7 +24,7 @@ _trg = createTrigger["EmptyDetector",getPos _lzLoc, true];
_trg setTriggerArea[lzSize,lzSize,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
_trg setTriggerTimeout [2.5, 2.5, 2.5, true];
_trgaction = format["null = [thisTrigger, '%2', (playersArray select %1), %3, %4, %1] execVM 'landingComplete.sqf'", _playerno, _taskid, _lzLoc, _lzLocs];
_trgaction = format["null = [thisTrigger, '%2', (playersArray select %1), %3, %1] execVM 'landingComplete.sqf'", _playerno, _taskid, _lzLoc];
_trgcond = "[thisList] call lzlanded";
diag_log format["LZ trigger condition: %1", _trgcond];
diag_log format["LZ trigger action: %1", _trgaction];

View File

@ -4,8 +4,7 @@ _trg = _this select 0;
_taskid = _this select 1;
_target = _this select 2;
_prevLZ = _this select 3;
_locs = _this select 4;
_playerno = _this select 5;
_playerno = _this select 4;
diag_log format["landingComplete called, _this: %1", _this];
@ -45,7 +44,7 @@ _trgLoaded setTriggerArea[lzSize,lzSize,0,false];
_trgLoaded setTriggerActivation["WEST","PRESENT",false];
_trgLoaded setTriggerTimeout [3, 3, 3, true];
_trgcond = format["(squadLoadedArray select %1)", _playerno];
_trgaction = format["null = [(playersArray select %1), %2, %3, %1] execVM 'createObj.sqf'; hint 'Fly to the next LZ!';", _playerno, _locs, _prevLZ];
_trgaction = format["null = [(playersArray select %1), %2, %3, %1] execVM 'createObj.sqf'; hint 'Fly to the next LZ!';", _playerno, null, _prevLZ];
diag_log format["load condition: %1", _trgcond];
diag_log format["load action: %1", _trgaction];
_trgLoaded setTriggerStatements[_trgcond, _trgaction, ""];

View File

@ -4,7 +4,6 @@ _returnValue = false;
{
_plr = _x;
_veh = vehicle _plr;
systemChat format["_plr: %1 _veh: %2 (isTouchingGround _veh): %3 _triggerList: %4", _plr, _veh, (isTouchingGround _veh), _triggerList];
if ( (_plr != _veh) && (isTouchingGround _veh) && (_veh in _triggerList) ) then
{
_returnValue = true;

View File

@ -6,7 +6,7 @@ playersArray set [_playerno, _target];
ferryingArray set [_playerno, false];
landingCompleteArray set [_playerno, false];
null = [(playersArray select _playerno), lzList, [], _playerno] execVM "createObj.sqf";
null = [(playersArray select _playerno), null, [], _playerno] execVM "createObj.sqf";
(playersArray select _playerno) addItem "SatchelCharge_Remote_Mag";
(playersArray select _playerno) addweapon "NVGoggles";