diff --git a/SQF/dayz_code/compile/object_removeNearby.sqf b/SQF/dayz_code/compile/object_removeNearby.sqf new file mode 100644 index 000000000..f4c4d2edc --- /dev/null +++ b/SQF/dayz_code/compile/object_removeNearby.sqf @@ -0,0 +1,15 @@ +private ["_nearByObjects","_targetObject"]; + +_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; +_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder); + +_nearByObjects = nearestObjects _this; + +if (count _nearByObjects == 0) exitWith { + cutText [(localize "str_epoch_player_8"), "PLAIN DOWN"]; +}; + +_targetObject = _nearByObjects select 0; +if (!isNull _targetObject and _canDo) then { + [0,1,2,_targetObject] spawn player_removeObject; +}; diff --git a/SQF/dayz_code/compile/object_removeNet.sqf b/SQF/dayz_code/compile/object_removeNet.sqf deleted file mode 100644 index 26d9b0ff7..000000000 --- a/SQF/dayz_code/compile/object_removeNet.sqf +++ /dev/null @@ -1,13 +0,0 @@ -private ["_nearNets","_nearNet"]; - -_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; -_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder); - -_nearNets = nearestObjects [player, ["DesertLargeCamoNet","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ"], 5]; -_nearNet = _nearNets select 0; - -if (!isNull _nearNet and _canDo) then { - [0,1,2,_nearNet] spawn player_removeObject; -} else { - cutText [(localize "str_epoch_player_8"), "PLAIN DOWN"]; -}; diff --git a/SQF/dayz_code/compile/object_removeTankTrap.sqf b/SQF/dayz_code/compile/object_removeTankTrap.sqf deleted file mode 100644 index 5e4086930..000000000 --- a/SQF/dayz_code/compile/object_removeTankTrap.sqf +++ /dev/null @@ -1,13 +0,0 @@ -private ["_nearTankTraps","_nearTankTrap"]; - -_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; -_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder); - -_nearTankTraps = nearestObjects [player, ["Hedgehog_DZ"], 1]; -_nearTankTrap = _nearTankTraps select 0; - - if (!isNull _nearTankTrap and _canDo) then { - [0,1,2,_nearTankTrap] spawn player_removeObject; - } else { - cutText [(localize "STR_EPOCH_ACTIONS_14"), "PLAIN DOWN"]; - }; diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index 2d5be8356..09d038553 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -33,8 +33,15 @@ if (!isDedicated) then { player_unlockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf"; player_removeObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\remove.sqf"; - player_removeNet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeNet.sqf"; - player_removeTankTrap = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeTankTrap.sqf"; + player_removeNearby = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeNearby.sqf"; + + player_removeTankTrap = { + [player, ["Hedgehog_DZ"], 1] call player_removeNearby; + }; + player_removeNet = { + [player, ["DesertLargeCamoNet","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ"], 5] call player_removeNearby; + }; + player_unlockDoor = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockDoor.sqf"; player_changeCombo = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_changeCombo.sqf"; @@ -43,10 +50,6 @@ if (!isDedicated) then { // control_zombieAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\control_zombieAgent.sqf"; player_updateGui = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_updateGui.sqf"; player_crossbowBolt = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_crossbowBolt.sqf"; - //spawn_flies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_flies.sqf"; - // stream_locationFill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationFill.sqf"; - // stream_locationDel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationDel.sqf"; - // stream_locationCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationCheck.sqf"; player_music = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_music.sqf"; //Used to generate ambient music player_login = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_login.sqf"; //Used to generate ambient music player_death = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_death.sqf";