diff --git a/SQF/dayz_code/actions/flare_pickup.sqf b/SQF/dayz_code/actions/flare_pickup.sqf index e093a2209..aff037ae8 100644 --- a/SQF/dayz_code/actions/flare_pickup.sqf +++ b/SQF/dayz_code/actions/flare_pickup.sqf @@ -4,7 +4,7 @@ player playActionNow "PutDown"; sleep 2; _flare attachTo [player,[0,0,0],"granat2"]; [_flare, -90, -10] call object_setpitchbank; -_flare setPos (getPos _flare); +[_flare] call FNC_GetSetPos; _flare setVariable ["owner",player,true]; player removeAction s_player_grabflare; player removeAction s_player_removeflare; diff --git a/SQF/dayz_code/actions/player_findLights.sqf b/SQF/dayz_code/actions/player_findLights.sqf index af7f2cfd9..f1b4d1b0c 100644 --- a/SQF/dayz_code/actions/player_findLights.sqf +++ b/SQF/dayz_code/actions/player_findLights.sqf @@ -21,4 +21,4 @@ _findNearestlight = []; }; }; -} foreach nearestObjects [getPos player, [], 20]; +} foreach nearestObjects [([player] call FNC_getPos), [], 20]; diff --git a/SQF/dayz_code/actions/player_harvestPlant.sqf b/SQF/dayz_code/actions/player_harvestPlant.sqf index 9da034bce..d65c45b41 100644 --- a/SQF/dayz_code/actions/player_harvestPlant.sqf +++ b/SQF/dayz_code/actions/player_harvestPlant.sqf @@ -39,7 +39,7 @@ _findNearestTree = []; }; }; -} foreach nearestObjects [getPos player, [], 10]; +} foreach nearestObjects [([player] call FNC_getPos), [], 10]; //diag_log format["DEBUG TREES: %1", _findNearestTree]; diff --git a/SQF/dayz_code/actions/player_heliLift.sqf b/SQF/dayz_code/actions/player_heliLift.sqf index fffedddc6..66f1008ea 100644 --- a/SQF/dayz_code/actions/player_heliLift.sqf +++ b/SQF/dayz_code/actions/player_heliLift.sqf @@ -33,8 +33,8 @@ while {r_doLoop} do { _animState = animationState player; _isMedic = ["medic",_animState] call fnc_inString; - _posL = getPos _liftHeli; - _posC = getPos _vehicle; + _posL = [_liftHeli] call FNC_getPos; + _posC = [_vehicle] call FNC_getPos; _height = (_posL select 2) - (_posC select 2); /* if(_height < 20) then { @@ -72,7 +72,7 @@ if(_finished) then { while {r_doLoop} do { _attached = _vehicle getVariable["attached",false]; - if(((getPos _liftHeli) select 2) < 5) then { + if ((([_liftHeli] call FNC_getPos) select 2) < 5) then { r_doLoop = false; }; diff --git a/SQF/dayz_code/actions/tame_dog.sqf b/SQF/dayz_code/actions/tame_dog.sqf index 29e904f84..4a1ea6f78 100644 --- a/SQF/dayz_code/actions/tame_dog.sqf +++ b/SQF/dayz_code/actions/tame_dog.sqf @@ -46,7 +46,7 @@ if(_removed == _countIn) then { sleep 1; //diag_log format["DEBUG: %1, id: %2 [%3]",_dog,_animalID,completedFSM _animalID]; if (!moveToCompleted _dog) then { - _dog moveTo (position _dog); + _dog moveTo ([_dog] call FNC_GetPos); }; _dog disableAI "FSM"; (group _dog) setBehaviour "AWARE"; diff --git a/SQF/dayz_code/actions/trade_any_bicycle.sqf b/SQF/dayz_code/actions/trade_any_bicycle.sqf index 5028b3c8b..bf2343f5d 100644 --- a/SQF/dayz_code/actions/trade_any_bicycle.sqf +++ b/SQF/dayz_code/actions/trade_any_bicycle.sqf @@ -128,7 +128,7 @@ if (_finished) then { if(count _helipad > 0) then { _location = (getPosATL (_helipad select 0)); } else { - _location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos; + _location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos; }; //place vehicle spawn marker (local) diff --git a/SQF/dayz_code/actions/trade_any_bicycle_old.sqf b/SQF/dayz_code/actions/trade_any_bicycle_old.sqf index 4beb9de0e..74e992e2b 100644 --- a/SQF/dayz_code/actions/trade_any_bicycle_old.sqf +++ b/SQF/dayz_code/actions/trade_any_bicycle_old.sqf @@ -105,7 +105,7 @@ if (_qty >= _qty_in) then { if(count _helipad > 0) then { _location = (getPosATL (_helipad select 0)); } else { - _location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos; + _location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos; }; //place vehicle spawn marker (local) diff --git a/SQF/dayz_code/actions/trade_any_boat.sqf b/SQF/dayz_code/actions/trade_any_boat.sqf index d4cde2d50..065e8762a 100644 --- a/SQF/dayz_code/actions/trade_any_boat.sqf +++ b/SQF/dayz_code/actions/trade_any_boat.sqf @@ -146,7 +146,7 @@ if (_finished) then { if(count _helipad > 0) then { _location = (getPosATL (_helipad select 0)); } else { - _location = [(position player),0,20,1,2,2000,0] call BIS_fnc_findSafePos; + _location = [([player] call FNC_GetPos),0,20,1,2,2000,0] call BIS_fnc_findSafePos; }; //place vehicle spawn marker (local) diff --git a/SQF/dayz_code/actions/trade_any_boat_old.sqf b/SQF/dayz_code/actions/trade_any_boat_old.sqf index cdc694c17..706368507 100644 --- a/SQF/dayz_code/actions/trade_any_boat_old.sqf +++ b/SQF/dayz_code/actions/trade_any_boat_old.sqf @@ -122,7 +122,7 @@ if (_qty >= _qty_in) then { if(count _helipad > 0) then { _location = (getPosATL (_helipad select 0)); } else { - _location = [(position player),0,20,1,2,2000,0] call BIS_fnc_findSafePos; + _location = [([player] call FNC_GetPos),0,20,1,2,2000,0] call BIS_fnc_findSafePos; }; //place vehicle spawn marker (local) diff --git a/SQF/dayz_code/actions/trade_any_vehicle.sqf b/SQF/dayz_code/actions/trade_any_vehicle.sqf index 8c5efda03..55486bb91 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle.sqf @@ -146,7 +146,7 @@ if (_finished) then { if(count _helipad > 0) then { _location = (getPosATL (_helipad select 0)); } else { - _location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos; + _location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos; }; //place vehicle spawn marker (local) diff --git a/SQF/dayz_code/actions/trade_any_vehicle_free.sqf b/SQF/dayz_code/actions/trade_any_vehicle_free.sqf index 850c99d31..cd393e8f3 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle_free.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle_free.sqf @@ -128,7 +128,7 @@ if (_finished) then { if(count _helipad > 0) then { _location = (getPosATL (_helipad select 0)); } else { - _location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos; + _location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos; }; //place vehicle spawn marker (local) diff --git a/SQF/dayz_code/actions/trade_any_vehicle_old.sqf b/SQF/dayz_code/actions/trade_any_vehicle_old.sqf index 57ea8ac9f..38a17c997 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle_old.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle_old.sqf @@ -130,7 +130,7 @@ if (_qty >= _qty_in) then { if(count _helipad > 0) then { _location = (getPosATL (_helipad select 0)); } else { - _location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos; + _location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos; }; //place vehicle spawn marker (local) diff --git a/SQF/dayz_code/compile/BIS_fnc/fn_halo.sqf b/SQF/dayz_code/compile/BIS_fnc/fn_halo.sqf index c9f2a721e..f0d753b23 100644 --- a/SQF/dayz_code/compile/BIS_fnc/fn_halo.sqf +++ b/SQF/dayz_code/compile/BIS_fnc/fn_halo.sqf @@ -27,7 +27,7 @@ if (typename _this == typename objnull) then { //--- PLAYER ------------------------------------------------ _brightness = 0.99; - _pos = position player; + _pos = [player] call FNC_GetPos; _parray = [ /* 00 */ ["\Ca\Data\ParticleEffects\Universal\Universal", 16, 12, 13, 0], /* 01 */ "", @@ -192,9 +192,10 @@ if (typename _this == typename objnull) then { }; } else { //--- AI ------------------------------------------------ - while {(position _unit select 2) > 100} do { + while {(([_unit] call FNC_GetPos) select 2) > 100} do { _destination = expecteddestination _unit select 0; - if (_destination distance [position _unit select 0,position _unit select 1,0] > 10) then { + _unitPosition = [_unit] call FNC_GetPos; + if ((_destination distance [(_unitPosition select 0),(_unitPosition select 1),0]) > 10) then { _vel = velocity _unit; _dirTo = [_unit,_destination] call bis_fnc_dirto; if (player distance _unit > 500) then { @@ -223,7 +224,8 @@ if (typename _this == typename []) then { //--- Free fall if (count _this == 2) exitwith { _alt = _this select 1; - _unit setpos [position _unit select 0,position _unit select 1,_alt]; + _paraPosition = [_unit] call FNC_GetPos; + _unit setpos [(_paraPosition select 0),(_paraPosition select 1),_alt]; _unit setvariable ["bis_fnc_halo_now",true]; _unit spawn bis_fnc_halo; }; @@ -231,9 +233,10 @@ if (typename _this == typename []) then { _para = objnull; _vel = []; - _para = "ParachuteWest" createVehicle position _unit; + _paraPosition1 = [_unit] call FNC_GetPos; + _para = createVehicle ["ParachuteWest", _paraPosition1, [], 0, "CAN_COLLIDE"]; //_para = "BIS_Steerable_Parachute" createVehicle position _unit; - _para setpos position _unit; + _para setpos _paraPosition1; _para setdir direction _unit; _vel = velocity _unit; _unit moveindriver _para; @@ -339,7 +342,7 @@ if (typename _this == typename []) then { //--- End //waituntil {vehicle player == player}; player setvariable ["bis_fnc_halo_terminate",nil]; - waituntil {(position vehicle player select 2) < 2 || !isnil {player getvariable "bis_fnc_halo_terminate"}}; + waituntil {(([(vehicle player)] call FNC_GetPos) select 2) < 2 || !isnil {player getvariable "bis_fnc_halo_terminate"}}; (finddisplay 46) displayremoveeventhandler ["keydown",bis_fnc_halo_para_keydown_eh]; (finddisplay 46) displayremoveeventhandler ["mousemoving",bis_fnc_halo_para_mousemoving_eh]; (finddisplay 46) displayremoveeventhandler ["mouseholding",bis_fnc_halo_para_mouseholding_eh]; diff --git a/SQF/dayz_code/compile/fn_lightFunctions.sqf b/SQF/dayz_code/compile/fn_lightFunctions.sqf index 88bdadcc4..8021b84ff 100644 --- a/SQF/dayz_code/compile/fn_lightFunctions.sqf +++ b/SQF/dayz_code/compile/fn_lightFunctions.sqf @@ -23,7 +23,7 @@ _lights = ["a_fuelstation_sign.p3d","lampa_ind_zebr.p3d","lampa_ind.p3d","lampa_ }; }; }; - } foreach nearestObjects [getPos _target, [], _rng]; + } foreach nearestObjects [([_target] call FNC_getPos), [], _rng]; }; @@ -86,10 +86,10 @@ _lCol = _this select 0; _lbrt = _this select 1; _lamb = _this select 2; _doLit = _this select 4 select 0; -_twrPos = getPos _twr; +_twrPos = ([_twr] call FNC_getPos); _rad=2.65; _oset=14; -_nrTLs= position _twr nearObjects ["#lightpoint",20]; +_nrTLs= _twrPos nearObjects ["#lightpoint",20]; if(count _nrTLs > 3)then{ //axeDiagLog = format["FN:TL FOUND LP:%1",count _nrTLs]; diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index 2d2f1cbbc..02bdc5dc3 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -39,7 +39,7 @@ if (_canPickLight and !dayz_hasLight and !_isPZombie) then { if (DZE_HeliLift) then { _hasAttached = _vehicle getVariable["hasAttached",false]; - if(_inVehicle and (_vehicle isKindOf "Air") and ((getPos _vehicle select 2) < 30) and (speed _vehicle < 5) and (typeName _hasAttached == "OBJECT")) then { + if(_inVehicle and (_vehicle isKindOf "Air") and ((([_vehicle] call FNC_getPos) select 2) < 30) and (speed _vehicle < 5) and (typeName _hasAttached == "OBJECT")) then { if (s_player_heli_detach < 0) then { dayz_myLiftVehicle = _vehicle; s_player_heli_detach = dayz_myLiftVehicle addAction ["Detach Vehicle","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,false,true,"",""]; @@ -51,7 +51,7 @@ if (DZE_HeliLift) then { }; if(DZE_HaloJump) then { - if(_inVehicle and (_vehicle isKindOf "Air") and ((getPos _vehicle select 2) > 400)) then { + if(_inVehicle and (_vehicle isKindOf "Air") and ((([_vehicle] call FNC_getPos) select 2) > 400)) then { if (s_halo_action < 0) then { DZE_myHaloVehicle = _vehicle; s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,false,true,"",""]; @@ -285,8 +285,8 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu _liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15]; { if(!_found) then { - _posL = getPos _x; - _posC = getPos _cursorTarget; + _posL = [_x] call FNC_getPos; + _posC = [_cursorTarget] call FNC_getPos; _height = (_posL select 2) - (_posC select 2); _hasAttached = _x getVariable["hasAttached",false]; if(_height < 15 and _height > 5 and (typeName _hasAttached != "OBJECT")) then { diff --git a/SQF/dayz_code/compile/local_lights_house.sqf b/SQF/dayz_code/compile/local_lights_house.sqf index d808c7bff..e63bd89e3 100644 --- a/SQF/dayz_code/compile/local_lights_house.sqf +++ b/SQF/dayz_code/compile/local_lights_house.sqf @@ -101,11 +101,11 @@ if(!isNil "_objHouse")then{ //publicVariable "axeDiagLog"; _objLightPoint = nearestObject [_x, "#lightpoint"]; - _pos = getPos _x; + _pos = [_x] call FNC_getPos; _dir = getDir _x; if(_plyr distance _x < _lpRange)then{//If within create radius - [_lmpCol,_brtns,_lmpCol,getPos _x,_dir,[0,0,-1]] call axe_newLightPoint; + [_lmpCol,_brtns,_lmpCol,_pos,_dir,[0,0,-1]] call axe_newLightPoint; //_x setVariable ["axeHLight", 1, false]; }; @@ -124,7 +124,7 @@ if(!isNil "_objHouse")then{ if(count _litHouses > 0 )then{ { _objLightPoint = nearestObject [_x, "#lightpoint"]; - _pos = getPos _x; + _pos = [_x] call FNC_getPos; if((abs ([_pos, _objLightPoint] call BIS_fnc_distance2D))<_hsLPDist)then{//In House if(_plyr distance _x < _lpRange)then{//If within range and outside band @@ -147,7 +147,7 @@ if(!isNil "_objHouse")then{ }else{ if(_plyr distance _x < _lpRange)then{//If within create radius recreate lightpoint (after logging) _brtns = [_plyr,_x] call axe_lightBrightness; - [_lmpCol,_brtns,_lmpCol,getPos _x,_dir,[0,0,-2.6]] call axe_newLightPoint; + [_lmpCol,_brtns,_lmpCol,_pos,_dir,[0,0,-2.6]] call axe_newLightPoint; //axeDiagLog = format["HL:Recreating light %1 for %2 ",_x,name player]; //publicVariable "axeDiagLog"; }; diff --git a/SQF/dayz_code/compile/local_lights_init.sqf b/SQF/dayz_code/compile/local_lights_init.sqf index 65abbf758..56e12c9df 100644 --- a/SQF/dayz_code/compile/local_lights_init.sqf +++ b/SQF/dayz_code/compile/local_lights_init.sqf @@ -30,7 +30,7 @@ if(!isDedicated)then{ axeTowerLights = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lights_tower.sqf"; axeHouseLights = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lights_house.sqf"; - waitUntil {getPos Player select 0 > 0}; + waitUntil {(([Player] call FNC_getPos) select 0) > 0}; //Detect Dusk and Dawn _sunrise = call world_sunRise; @@ -101,7 +101,7 @@ if(!isDedicated)then{ }; }; //}; - _plyPos = getPos player; + _plyPos = [Player] call FNC_getPos; }; sleep _slpTime; }; diff --git a/SQF/dayz_code/compile/local_lights_off.sqf b/SQF/dayz_code/compile/local_lights_off.sqf index b202f1286..43ac03af3 100644 --- a/SQF/dayz_code/compile/local_lights_off.sqf +++ b/SQF/dayz_code/compile/local_lights_off.sqf @@ -16,7 +16,7 @@ _objHouses = nearestObjects [_nrstTrig, ["House"], _hsRange]; _hsCount = count _objHouses; _rnd = random _hsCount; _objHouse = _objHouses select _rnd; - _pos = getPos _objHouse; + _pos = [_objHouse] call FNC_getPos; _lightstate = _objHouse animationPhase "Lights_1"; if(_lightstate==1) then{ _animlightpoint = nearestObject [_objHouse, "#lightpoint"]; @@ -47,7 +47,7 @@ _nrTowers = nearestObjects [_nrstTrig, ["Land_Ind_IlluminantTower"], _rng]; if(count _objHouses >0)then{ { _objLightPoint = nearestObject [_x, "#lightpoint"]; - if((abs ([getPos _x, _objLightPoint] call BIS_fnc_distance2D))<1.5)then{ + if((abs ([([_x] call FNC_getPos), _objLightPoint] call BIS_fnc_distance2D))<1.5)then{ deleteVehicle _objLightPoint; }; }forEach _objHouses; @@ -65,7 +65,7 @@ _nrTowers = nearestObjects [_nrstTrig, ["Land_Ind_IlluminantTower"], _rng]; { for "_s" from 1 to 4 do { _objLightPoint = nearestObject [_x, "#lightpoint"]; - if((abs ([getPos _x, _objLightPoint] call BIS_fnc_distance2D))<25)then{ + if((abs ([([_x] call FNC_getPos), _objLightPoint] call BIS_fnc_distance2D))<25)then{ deleteVehicle _objLightPoint; }; }; diff --git a/SQF/dayz_code/compile/object_showPlotRadius.sqf b/SQF/dayz_code/compile/object_showPlotRadius.sqf index 1aee373ef..e47eb477b 100644 --- a/SQF/dayz_code/compile/object_showPlotRadius.sqf +++ b/SQF/dayz_code/compile/object_showPlotRadius.sqf @@ -7,13 +7,13 @@ _nearPlotPole = nearestObject [player, "Plastic_Pole_EP1_DZ"]; //"privatized" center variable _BD_radius = DZE_PlotPole select 0; -_BD_center = getPos _nearPlotPole; +_BD_center = [_nearPlotPole] call FNC_getPos; _objects = []; // circle for "_i" from 0 to 360 step (270 / _BD_radius) do { _location = [(_BD_center select 0) + ((cos _i) * _BD_radius), (_BD_center select 1) + ((sin _i) * _BD_radius), _BD_center select 2]; - _object = "Plastic_Pole_EP1" createVehicle _location; + _object = createVehicle ["Plastic_Pole_EP1", _location, [], 0, "CAN_COLLIDE"]; _object setpos _location; }; diff --git a/SQF/dayz_code/compile/player_crossbowBolt.sqf b/SQF/dayz_code/compile/player_crossbowBolt.sqf index 124bad5a6..cfda02cb2 100644 --- a/SQF/dayz_code/compile/player_crossbowBolt.sqf +++ b/SQF/dayz_code/compile/player_crossbowBolt.sqf @@ -54,7 +54,7 @@ if (_height < 100) then { _bolt attachTo [_hitObject,_val,_hitMemoryPt]; _dir = ([_hitObject,_unit] call BIS_fnc_relativeDirTo) + 180; _bolt setDir (_dir); - _bolt setPos (getPos _bolt); + [_bolt] call FNC_GetSetPos; _unit setVariable["firedHit",[]]; _unit setVariable["firedDamage",0,true]; }; diff --git a/SQF/dayz_code/compile/player_projectileNear.sqf b/SQF/dayz_code/compile/player_projectileNear.sqf index e6e5b16c1..54dcc4ec4 100644 --- a/SQF/dayz_code/compile/player_projectileNear.sqf +++ b/SQF/dayz_code/compile/player_projectileNear.sqf @@ -19,7 +19,7 @@ while {(alive _projectile) && !(isNull _projectile) && _callCount < 85;} do { if (_projectflight > 0) then { sleep (12 / (_projectflight)); }; - if (alive _projectile && !(isNull _projectile)) then {_currentNear = (Position _projectile) nearEntities [["CAManBase","AllVehicles"],15];}; + if (alive _projectile && !(isNull _projectile)) then {_currentNear = ([_projectile] call FNC_GetPos) nearEntities [["CAManBase","AllVehicles"],15];}; _listNear = _listNear + _currentNear; _callCount = _callCount + 1; }; diff --git a/SQF/dayz_code/compile/player_tameDog.sqf b/SQF/dayz_code/compile/player_tameDog.sqf index b479a09f8..346457406 100644 --- a/SQF/dayz_code/compile/player_tameDog.sqf +++ b/SQF/dayz_code/compile/player_tameDog.sqf @@ -3,7 +3,7 @@ _target = _this select 0; //_caller = _this select 1; _id = _this select 2; //_params = _this select 3; -_pos = position _target; +_pos = [_target] call FNC_GetPos; _hasRawMeat = "FoodSteakRaw" in magazines player; _hasdog = player getVariable ["dogid", "false"]; diff --git a/SQF/dayz_code/compile/player_zombieCheck.sqf b/SQF/dayz_code/compile/player_zombieCheck.sqf index 1c8b3df67..44ee80bbf 100644 --- a/SQF/dayz_code/compile/player_zombieCheck.sqf +++ b/SQF/dayz_code/compile/player_zombieCheck.sqf @@ -1,6 +1,6 @@ private ["_listTalk","_eyeDir","_attacked","_continue","_type","_chance","_last","_refObj","_inAngle","_tPos","_zPos","_cantSee","_entHeight","_delta","_targets","_pHeight","_lowBlood","_dist"]; _refObj = vehicle player; -_listTalk = (getPos _refObj) nearEntities ["zZombie_Base",80]; +_listTalk = ([_refObj] call FNC_GetPos) nearEntities ["zZombie_Base",80]; _pHeight = (getPosATL _refObj) select 2; _attacked = false; { diff --git a/SQF/dayz_code/compile/tame_dog.sqf b/SQF/dayz_code/compile/tame_dog.sqf index 0cb529681..a53fd73fc 100644 --- a/SQF/dayz_code/compile/tame_dog.sqf +++ b/SQF/dayz_code/compile/tame_dog.sqf @@ -25,7 +25,7 @@ _animalID setFSMVariable ["_isTamed", true]; sleep 1; diag_log format["DEBUG: %1, id: %2 [%3]",_dog,_animalID,completedFSM _animalID]; if (!moveToCompleted _dog) then { - _dog moveTo (position _dog); + _dog moveTo ([_dog] call FNC_GetPos); }; _dog disableAI "FSM"; (group _dog) setBehaviour "AWARE"; diff --git a/SQF/dayz_code/compile/zombie_loiter.sqf b/SQF/dayz_code/compile/zombie_loiter.sqf index 47db6cf10..29e4b32b8 100644 --- a/SQF/dayz_code/compile/zombie_loiter.sqf +++ b/SQF/dayz_code/compile/zombie_loiter.sqf @@ -2,7 +2,7 @@ private ["_unit","_originalPos","_pos","_chance","_playerpos"]; _unit = _this select 0; _originalPos = _this select 1; _pos = getPosATL _unit; -_playerpos = getPos player; +_playerpos = ([player] call FNC_GetPos); if (count _this > 2) then { _pos = _this select 2; diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index e0a713287..7aa780683 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -381,7 +381,7 @@ if (!isDedicated) then { } forEach _objInfo; _i = _i + 2; // skip the ": " part for "_k" from _i to _lenInfo do { - _objName = _objName + [_objInfo select _k]; + _objName set [(count _objName), (_objInfo select _k)]; }; _objName = toLower(toString(_objName)); _objName @@ -527,7 +527,26 @@ if (!isDedicated) then { spawn_loot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot.sqf"; spawn_loot_small = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot_small.sqf"; // player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf"; - + FNC_GetSetPos = { //DO NOT USE IF YOU NEED ANGLE COMPENSATION!!!! + private "_pos"; + _thingy = _this select 0; + _pos = getPosASL _thingy; + if (surfaceIsWater _pos) then { + _thingy setPosASL _pos; + } else { + _thingy setPosATL (ASLToATL _pos); + }; + }; + FNC_GetPos = { + private "_pos"; + if (isNil {_this select 0}) exitWith {[0,0,0]}; + _thingy = _this select 0; + _pos = getPosASL _thingy; + if !(surfaceIsWater _pos) then { + _pos = ASLToATL _pos; + }; + _pos + }; local_setFuel = { private["_qty","_vehicle"]; _vehicle = ; diff --git a/SQF/dayz_code/medical/load/unLoad_act.sqf b/SQF/dayz_code/medical/load/unLoad_act.sqf index 8732aad46..787d3ca06 100644 --- a/SQF/dayz_code/medical/load/unLoad_act.sqf +++ b/SQF/dayz_code/medical/load/unLoad_act.sqf @@ -1,7 +1,7 @@ // unLoad_act.sqf // AUGUST 2010 - norrin -private ["_args","_vcl","_loop","_position","_isOnDeck","_unit","_name","_crewVcl"]; +private ["_args","_vcl","_loop","_unit","_name","_crewVcl"]; _args = _this select 3; _name = _args select 0; @@ -20,11 +20,6 @@ for [{ _loop = 0 },{ _loop < count _crewVcl },{ _loop = _loop + 1}] do sleep 0.05; _unit action ["EJECT", _vcl]; sleep 1; - _position = position _unit; - _isOnDeck = getPos _unit in LHA_Deck; - if (_isOnDeck) then { - _unit setPosAsl [(_position select 0), (_position select 1), (LHA_height+1)]; - }; _unit switchMove ""; _unit switchMove "ainjppnemstpsnonwrfldnon"; sleep 0.2; diff --git a/SQF/dayz_code/medical/setup_functions_med.sqf b/SQF/dayz_code/medical/setup_functions_med.sqf index 950082ebf..7a30ec4f0 100644 --- a/SQF/dayz_code/medical/setup_functions_med.sqf +++ b/SQF/dayz_code/medical/setup_functions_med.sqf @@ -50,7 +50,7 @@ fnc_usec_damageUnconscious = { private["_veh","_unit"]; _veh = vehicle _this; _unit = _this; - waitUntil{(((position _veh select 2 < 1) and (speed _veh < 1)) or (!r_player_unconscious))}; + waitUntil{(((([_veh] call FNC_GetPos) select 2 < 1) and (speed _veh < 1)) or (!r_player_unconscious))}; if (r_player_unconscious) then { _unit action ["eject", _veh]; waitUntil{((vehicle _this) != _this)}; diff --git a/SQF/dayz_code/system/BIS_Effects/secondaries.sqf b/SQF/dayz_code/system/BIS_Effects/secondaries.sqf index 8b3c75039..974e015c3 100644 --- a/SQF/dayz_code/system/BIS_Effects/secondaries.sqf +++ b/SQF/dayz_code/system/BIS_Effects/secondaries.sqf @@ -23,5 +23,5 @@ while {_int>1} do { sleep _x; if((_lifecheck&&(alive _v))||(isnull _v)||(((getposASL _v)select 2)<0))exitwith{}; - "SmallSecondary" createvehicle(_v modelToWorld _effect2pos); + createVehicle ["SmallSecondary", (_v modelToWorld _effect2pos), [], 0, "CAN_COLLIDE"]; }foreach(_list); \ No newline at end of file diff --git a/SQF/dayz_code/system/REsec.sqf b/SQF/dayz_code/system/REsec.sqf index 285355db5..ddcc0ceec 100644 --- a/SQF/dayz_code/system/REsec.sqf +++ b/SQF/dayz_code/system/REsec.sqf @@ -46,7 +46,7 @@ private["_ofn","_nfn","_REMOVED_LIB","_TRACED_LIB"]; if(typeName _co==""STRING"")then{ { if(!((_x>=65&&_x<=90)OR(_x>=97&&_x<=122))) exitWith {diag_log(""WARNING possible code injection args:""+str(_this)); _this=[];}; - }forEach toArray _co; + }forEach (toArray _co); }; }; _this call "+_nfn+"};" diff --git a/SQF/dayz_code/system/ca/functions/init.sqf b/SQF/dayz_code/system/ca/functions/init.sqf index f88ecba80..964e5d2d0 100644 --- a/SQF/dayz_code/system/ca/functions/init.sqf +++ b/SQF/dayz_code/system/ca/functions/init.sqf @@ -90,7 +90,7 @@ for "_t" from 0 to 2 do { //" private ["_test", "_test2"]; -_test = (_this select 0) setPos (position (_this select 0)); if (isnil "_test") then {_test = false}; +_test = (_this select 0) setPos ([(_this select 0)] call FNC_GetPos); if (isnil "_test") then {_test = false}; _test2 = (_this select 0) playMove ""; if (isnil "_test2") then {_test2 = false}; _testvar = getText (configFile >> "CfgMissions" >> "Missions" >> "SP_BearRising" >> "directory"); if (_testvar != "") then { diff --git a/SQF/dayz_code/system/dog_agent.fsm b/SQF/dayz_code/system/dog_agent.fsm index f10f8e25f..b7f4f3788 100644 --- a/SQF/dayz_code/system/dog_agent.fsm +++ b/SQF/dayz_code/system/dog_agent.fsm @@ -285,7 +285,7 @@ class FSM "_target = objNull;" \n "_attackTarget = objNull;" \n "_target setVariable ['forceWalk',false];" \n - "_pos = position _dog;" \n + "_pos = [_dog] call FNC_GetPos;" \n "_lastPos = _pos;" \n "_move = """";" \n "_movePos = [];" \n @@ -325,7 +325,7 @@ class FSM class Moving { name = "Moving"; - init = /*%FSM*/"_pos = [(getPos (vehicle player)),1,2,4,0,5,0] call BIS_fnc_findSafePos;" \n + init = /*%FSM*/"_pos = [([(vehicle player)] call FNC_GetPos),1,2,4,0,5,0] call BIS_fnc_findSafePos;" \n "" \n "_dog moveTo _pos;" \n "_dog forceSpeed (_speedVal select _maxSpeed);" \n @@ -629,7 +629,7 @@ class FSM class Tracking { name = "Tracking"; - init = /*%FSM*/"_pos = [(getPos _target),1,2,4,0,5,0] call BIS_fnc_findSafePos;" \n + init = /*%FSM*/"_pos = [([_target] call FNC_GetPos),1,2,4,0,5,0] call BIS_fnc_findSafePos;" \n "_dog moveTo _pos;" \n "_dog forceSpeed (_speedVal select _maxSpeed);" \n "_forceChange = false;" \n @@ -707,9 +707,9 @@ class FSM class Checking { name = "Checking"; - init = /*%FSM*/"_lastPos = position _dog;" \n + init = /*%FSM*/"_lastPos = [_dog] call FNC_GetPos;" \n "" \n - "_list = (position _dog) nearEntities [""Animal"",(_senseSkill * 3)];" \n + "_list = ([_dog] call FNC_GetPos) nearEntities [""Animal"",(_senseSkill * 3)];" \n "_list = _list - [_dog];" \n "" \n "if (count _list > 0) then {" \n @@ -750,7 +750,7 @@ class FSM to="Tracking"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!isNull _target and ((time - _waitTime) > 2)"/*%FSM*/; - action=/*%FSM*/"_lastPos = position _dog;"/*%FSM*/; + action=/*%FSM*/"_lastPos = [_dog] call FNC_GetPos;"/*%FSM*/; }; /*%FSM*/ }; @@ -898,7 +898,7 @@ class FSM condition=/*%FSM*/"!(isNull _attackTarget)"/*%FSM*/; action=/*%FSM*/"_command = ""none"";" \n "if (!moveToCompleted _dog) then {" \n - " _dog moveTo (position _dog);" \n + " _dog moveTo ([_dog] call FNC_GetPos);" \n "};" \n "diag_log ""DEBUG: HAS TARGET"";"/*%FSM*/; }; @@ -921,7 +921,7 @@ class FSM precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"((time - _lostTime) > 60 && _waitTime > 1) || (_lostTarget && _waitTime > 1)"/*%FSM*/; action=/*%FSM*/"_dog playActionNow ""GestureSniff"";" \n - "_pos = [(getPos _dog),10,90,4,0,5,0] call BIS_fnc_findSafePos;"/*%FSM*/; + "_pos = [([_dog] call FNC_GetPos),10,90,4,0,5,0] call BIS_fnc_findSafePos;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ @@ -963,7 +963,7 @@ class FSM condition=/*%FSM*/"(vehicle _character == _character)"/*%FSM*/; action=/*%FSM*/"if (isNull _dog) then {" \n " _dog = createAgent [_type, _Pos, [], 0, ""NONE""];" \n - " _pos = [(getPos player),1,3,4,0,5,0] call BIS_fnc_findSafePos;" \n + " _pos = [([player] call FNC_GetPos),1,3,4,0,5,0] call BIS_fnc_findSafePos;" \n " _dog setpos _pos;" \n "} ;" \n "" \n @@ -977,7 +977,7 @@ class FSM class move_to_vehicle { name = "move_to_vehicle"; - init = /*%FSM*/"_playerloc = getPos (vehicle player);" \n + init = /*%FSM*/"_playerloc = [(vehicle player)] call FNC_GetPos;" \n "_dog moveTo _playerloc;" \n "" \n "diag_log ""DOG MOVING TO VEHICLE"";" \n @@ -1022,7 +1022,7 @@ class FSM class Wait { name = "Wait"; - init = /*%FSM*/"_pos = [(getPos _dog),10,90,4,0,5,0] call BIS_fnc_findSafePos;" \n + init = /*%FSM*/"_pos = [([_dog] call FNC_GetPos),10,90,4,0,5,0] call BIS_fnc_findSafePos;" \n "_dog moveTo _pos;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links diff --git a/SQF/dayz_code/system/player_monitor.fsm b/SQF/dayz_code/system/player_monitor.fsm index 0410dce4b..5ead38662 100644 --- a/SQF/dayz_code/system/player_monitor.fsm +++ b/SQF/dayz_code/system/player_monitor.fsm @@ -1249,7 +1249,7 @@ class FSM "dayz_slowCheck = [] spawn player_spawn_2;" \n "" \n "_world = toUpper(worldName); //toUpper(getText (configFile >> ""CfgWorlds"" >> (worldName) >> ""description""));" \n - "_nearestCity = nearestLocations [getPos player, [""NameCityCapital"",""NameCity"",""NameVillage"",""NameLocal""],1000];" \n + "_nearestCity = nearestLocations [([player] call FNC_GetPos), [""NameCityCapital"",""NameCity"",""NameVillage"",""NameLocal""],1000];" \n "Dayz_logonTown = ""Wilderness"";" \n "" \n "if (count _nearestCity > 0) then {Dayz_logonTown = text (_nearestCity select 0)};" \n diff --git a/SQF/dayz_code/system/player_spawn_1.sqf b/SQF/dayz_code/system/player_spawn_1.sqf index 8604a6b2b..71bdfe4d9 100644 --- a/SQF/dayz_code/system/player_spawn_1.sqf +++ b/SQF/dayz_code/system/player_spawn_1.sqf @@ -29,7 +29,7 @@ while {true} do { }; _world = toUpper(worldName); //toUpper(getText (configFile >> "CfgWorlds" >> (worldName) >> "description")); - _nearestCity = nearestLocations [getPos player, ["NameCityCapital","NameCity","NameVillage","NameLocal"],300]; + _nearestCity = nearestLocations [([player] call FNC_GetPos), ["NameCityCapital","NameCity","NameVillage","NameLocal"],300]; if (count _nearestCity > 0) then { _town = text (_nearestCity select 0); diff --git a/SQF/dayz_server/compile/server_maintainArea.sqf b/SQF/dayz_server/compile/server_maintainArea.sqf index 1c6afb77f..b7bcd6360 100644 --- a/SQF/dayz_server/compile/server_maintainArea.sqf +++ b/SQF/dayz_server/compile/server_maintainArea.sqf @@ -28,7 +28,7 @@ if (_option == 1) then { }; } forEach _objects; _name = if (alive _player) then { name _player; } else { "Dead Player"; }; - diag_log format ["MAINTAIN AREA BY %1 - %2 Objects at %3", _name, count _objects, position _player]; + diag_log format ["MAINTAIN AREA BY %1 - %2 Objects at %3", _name, count _objects, (getPosATL _player)]; }; if (_option == 2) then { if (damage _targetObj >= DZE_DamageBeforeMaint) then { diff --git a/SQF/dayz_server/compile/server_publishVehicle2.sqf b/SQF/dayz_server/compile/server_publishVehicle2.sqf index c7c04e367..4d0225a1f 100644 --- a/SQF/dayz_server/compile/server_publishVehicle2.sqf +++ b/SQF/dayz_server/compile/server_publishVehicle2.sqf @@ -79,8 +79,8 @@ _key call server_hiveWrite; if(!_done) exitWith { diag_log("CUSTOM: failed to get id for : " + str(_uid)); }; if(DZE_TRADER_SPAWNMODE) then { - _object_para = "ParachuteMediumWest" createVehicle [0,0,0]; - _object_para setpos [_location select 0, _location select 1,(_location select 2) + 65]; + _object_para = createVehicle ["ParachuteMediumWest", [0,0,0], [], 0, "CAN_COLLIDE"]; + _object_para setPos [_location select 0, _location select 1,(_location select 2) + 65]; _object = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"]; } else { _object = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"]; @@ -104,7 +104,7 @@ _key call server_hiveWrite; if(DZE_TRADER_SPAWNMODE) then { _object attachTo [_object_para, [0,0,-1.6]]; sleep 1.0; - WaitUntil{(getpos _object select 2) < 0.1}; + WaitUntil{(([_object] call FNC_GetPos) select 2) < 0.1}; detach _object; deleteVehicle _object_para; }; diff --git a/SQF/dayz_server/compile/server_spawnCrashSite.sqf b/SQF/dayz_server/compile/server_spawnCrashSite.sqf index 7405360ea..8f11275d2 100644 --- a/SQF/dayz_server/compile/server_spawnCrashSite.sqf +++ b/SQF/dayz_server/compile/server_spawnCrashSite.sqf @@ -15,7 +15,7 @@ _fadeFire = _this select 8; diag_log("CRASHSPAWNER: Starting spawn logic for Crash Spawner"); -while {true} do { +while {1 == 1} do { private["_timeAdjust","_timeToSpawn","_spawnRoll","_crash","_hasAdjustment","_newHeight","_adjustedPos"]; // Allows the variance to act as +/- from the spawn frequency timer _timeAdjust = round((random(_variance * 2)) - _variance); diff --git a/SQF/dayz_server/compile/server_spawnEvent.sqf b/SQF/dayz_server/compile/server_spawnEvent.sqf index 796a77b5b..3a44d4bf6 100644 --- a/SQF/dayz_server/compile/server_spawnEvent.sqf +++ b/SQF/dayz_server/compile/server_spawnEvent.sqf @@ -31,7 +31,7 @@ epoch_eventIsAny = { _boolReturn }; -while {true} do { +while {1 == 1} do { // Find current time from server _key = "CHILD:307:"; diff --git a/SQF/dayz_server/modules/drop_bombs.sqf b/SQF/dayz_server/modules/drop_bombs.sqf index 7d1c1fcb4..bf5a5d699 100644 --- a/SQF/dayz_server/modules/drop_bombs.sqf +++ b/SQF/dayz_server/modules/drop_bombs.sqf @@ -1,4 +1,4 @@ // Sample Drop Bomb private ["_position"]; _position = [MarkerPosition,0,DynamicVehicleArea,10,0,2000,0] call BIS_fnc_findSafePos; -bomb = "Bo_GBU12_LGB" createVehicle [(_position select 0),(_position select 1), 1000]; \ No newline at end of file +bomb = createVehicle ["Bo_GBU12_LGB", [(_position select 0),(_position select 1), 1000], [], 0, "CAN_COLLIDE"]; \ No newline at end of file