From cc032564758ebdeccb4fbe2e64812add0c4e2574 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Thu, 22 Sep 2016 18:12:52 -0400 Subject: [PATCH] Update purchased vehicle spawn location If there was no helipad available findSafePos was called. If that failed it spawned the vehicle in the debug zone. Calling findSafePos is no longer necessary since we are now using createVehicle "NONE". --- CHANGE LOG 1.0.6.txt | 2 ++ .../actions/AdvancedTrading/functions/z_at_buyItems.sqf | 5 +++-- SQF/dayz_code/actions/trade_any_bicycle.sqf | 5 +++-- SQF/dayz_code/actions/trade_any_bicycle_old.sqf | 5 +++-- SQF/dayz_code/actions/trade_any_boat.sqf | 5 +++-- SQF/dayz_code/actions/trade_any_boat_old.sqf | 5 +++-- SQF/dayz_code/actions/trade_any_vehicle.sqf | 5 +++-- SQF/dayz_code/actions/trade_any_vehicle_free.sqf | 5 +++-- SQF/dayz_code/actions/trade_any_vehicle_old.sqf | 5 +++-- SQF/dayz_server/compile/server_publishVehicle2.sqf | 1 + 10 files changed, 27 insertions(+), 16 deletions(-) diff --git a/CHANGE LOG 1.0.6.txt b/CHANGE LOG 1.0.6.txt index 7d0b838d2..ae75107ed 100644 --- a/CHANGE LOG 1.0.6.txt +++ b/CHANGE LOG 1.0.6.txt @@ -112,6 +112,8 @@ [FIXED] Mozzie helicopter noises, and crashed mozzies bouncing into orbit. @icomrade [FIXED] Firing from vehicles puts you in combat now. @icomrade [FIXED] Players will no longer end up swimming in the ground after spawn, relog or clothes change on maps with respawn_west in the water. @ebaydayz +[FIXED] It is no longer possible to drag players through base walls when they are unconscious. @icomrade +[FIXED] Purchased vehicles should no longer spawn inside each other on trader helipads. @icomrade [UPDATED] .hpp files updated in dayz_code\Configs\CfgLoot\CfgBuildingPos. @Uro1 [UPDATED] .bat files updated in Config-Examples @Raziel23x diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf index 5b3becd3c..17cacaba9 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf @@ -140,10 +140,11 @@ if (_enoughMoney) then { _dir = round(random 360); _helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100]; + // Note server now uses createVehicle "NONE" so next closest safePos is found automatically if location is blocked if (count _helipad > 0) then { - _location = (getPosATL (_helipad select 0)); + _location = getPosATL (_helipad select 0); } else { - _location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos; + _location = [player] call FNC_GetPos; }; _sign = "Sign_arrow_down_large_EP1" createVehicleLocal [0,0,0]; diff --git a/SQF/dayz_code/actions/trade_any_bicycle.sqf b/SQF/dayz_code/actions/trade_any_bicycle.sqf index afcace57f..f99b45c56 100644 --- a/SQF/dayz_code/actions/trade_any_bicycle.sqf +++ b/SQF/dayz_code/actions/trade_any_bicycle.sqf @@ -111,11 +111,12 @@ if (_finished) then { // spawn vehicle _dir = round(random 360); + // Note server now uses createVehicle "NONE" so next closest safePos is found automatically if location is blocked _helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100]; if(count _helipad > 0) then { - _location = (getPosATL (_helipad select 0)); + _location = getPosATL (_helipad select 0); } else { - _location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos; + _location = [player] call FNC_GetPos; }; //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 5534d636c..1f264627b 100644 --- a/SQF/dayz_code/actions/trade_any_bicycle_old.sqf +++ b/SQF/dayz_code/actions/trade_any_bicycle_old.sqf @@ -96,11 +96,12 @@ if (_qty >= _qty_in) then { if(_removed == _qty_in) then { _dir = round(random 360); + // Note server now uses createVehicle "NONE" so next closest safePos is found automatically if location is blocked _helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100]; if(count _helipad > 0) then { - _location = (getPosATL (_helipad select 0)); + _location = getPosATL (_helipad select 0); } else { - _location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos; + _location = [player] call FNC_GetPos; }; //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 4fbf2fa36..aaeb2e207 100644 --- a/SQF/dayz_code/actions/trade_any_boat.sqf +++ b/SQF/dayz_code/actions/trade_any_boat.sqf @@ -116,11 +116,12 @@ if (_finished) then { // spawn vehicle _dir = round(random 360); + // Note server now uses createVehicle "NONE" so next closest safePos is found automatically if location is blocked _helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100]; if(count _helipad > 0) then { - _location = (getPosATL (_helipad select 0)); + _location = getPosATL (_helipad select 0); } else { - _location = [([player] call FNC_GetPos),0,20,1,2,2000,0] call BIS_fnc_findSafePos; + _location = [player] call FNC_GetPos; }; //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 960543d68..2fb4727fc 100644 --- a/SQF/dayz_code/actions/trade_any_boat_old.sqf +++ b/SQF/dayz_code/actions/trade_any_boat_old.sqf @@ -102,11 +102,12 @@ if (_qty >= _qty_in) then { if(_removed == _qty_in) then { _dir = round(random 360); + // Note server now uses createVehicle "NONE" so next closest safePos is found automatically if location is blocked _helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100]; if(count _helipad > 0) then { - _location = (getPosATL (_helipad select 0)); + _location = getPosATL (_helipad select 0); } else { - _location = [([player] call FNC_GetPos),0,20,1,2,2000,0] call BIS_fnc_findSafePos; + _location = [player] call FNC_GetPos; }; //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 60e74a4be..440682c2f 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle.sqf @@ -115,11 +115,12 @@ if (_finished) then { // spawn vehicle _dir = round(random 360); + // Note server now uses createVehicle "NONE" so next closest safePos is found automatically if location is blocked _helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100]; if(count _helipad > 0) then { - _location = (getPosATL (_helipad select 0)); + _location = getPosATL (_helipad select 0); } else { - _location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos; + _location = [player] call FNC_GetPos; }; //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 3ef4f041a..83463c3e2 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle_free.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle_free.sqf @@ -114,11 +114,12 @@ if (_finished) then { // spawn vehicle _dir = round(random 360); + // Note server now uses createVehicle "NONE" so next closest safePos is found automatically if location is blocked _helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100]; if(count _helipad > 0) then { - _location = (getPosATL (_helipad select 0)); + _location = getPosATL (_helipad select 0); } else { - _location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos; + _location = [player] call FNC_GetPos; }; //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 71a95c01b..3967cb87d 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle_old.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle_old.sqf @@ -100,11 +100,12 @@ if (_qty >= _qty_in) then { if(_removed == _qty_in) then { _dir = round(random 360); + // Note server now uses createVehicle "NONE" so next closest safePos is found automatically if location is blocked _helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100]; if(count _helipad > 0) then { - _location = (getPosATL (_helipad select 0)); + _location = getPosATL (_helipad select 0); } else { - _location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos; + _location = [player] call FNC_GetPos; }; //place vehicle spawn marker (local) diff --git a/SQF/dayz_server/compile/server_publishVehicle2.sqf b/SQF/dayz_server/compile/server_publishVehicle2.sqf index c5064ecee..22fcc59df 100644 --- a/SQF/dayz_server/compile/server_publishVehicle2.sqf +++ b/SQF/dayz_server/compile/server_publishVehicle2.sqf @@ -74,6 +74,7 @@ _key call server_hiveWrite; _object = _class createVehicle [0,0,0]; } else { //_object = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"]; + // Don't use setPos or CAN_COLLIDE here. It will spawn inside other vehicles _object = _class createVehicle _location; };