From a8e2ce07b520081be8f205f0605c7cb88e880520 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Wed, 24 Aug 2016 13:34:11 -0400 Subject: [PATCH] Optimize some createVehicleLocal https://community.bistudio.com/wiki/Code_Optimisation#createVehicle.28Local.29 --- .../actions/AdvancedTrading/functions/z_at_buyItems.sqf | 3 ++- SQF/dayz_code/actions/trade_any_bicycle.sqf | 3 ++- SQF/dayz_code/actions/trade_any_bicycle_old.sqf | 3 ++- SQF/dayz_code/actions/trade_any_boat.sqf | 3 ++- SQF/dayz_code/actions/trade_any_boat_old.sqf | 3 ++- SQF/dayz_code/actions/trade_any_vehicle.sqf | 3 ++- SQF/dayz_code/actions/trade_any_vehicle_free.sqf | 3 ++- SQF/dayz_code/actions/trade_any_vehicle_old.sqf | 3 ++- SQF/dayz_code/compile/local_spawnObjects.sqf | 2 +- 9 files changed, 17 insertions(+), 9 deletions(-) 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 cb4749e78..46da539e4 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf @@ -146,7 +146,8 @@ if (_enoughMoney) then { _location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos; }; - _sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location; + _sign = "Sign_arrow_down_large_EP1" createVehicleLocal [0,0,0]; + _sign setPos _location; _location = [_sign] call FNC_GetPos; [_part_out,_sign] call fn_waitForObject; diff --git a/SQF/dayz_code/actions/trade_any_bicycle.sqf b/SQF/dayz_code/actions/trade_any_bicycle.sqf index 71da6ae82..300750d96 100644 --- a/SQF/dayz_code/actions/trade_any_bicycle.sqf +++ b/SQF/dayz_code/actions/trade_any_bicycle.sqf @@ -127,7 +127,8 @@ if (_finished) then { }; //place vehicle spawn marker (local) - _sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location; + _sign = "Sign_arrow_down_large_EP1" createVehicleLocal [0,0,0]; + _sign setPos _location; _location = [_sign] call FNC_GetPos; [_part_out,_sign] call fn_waitForObject; diff --git a/SQF/dayz_code/actions/trade_any_bicycle_old.sqf b/SQF/dayz_code/actions/trade_any_bicycle_old.sqf index d00fb7ded..8c1ae6bb0 100644 --- a/SQF/dayz_code/actions/trade_any_bicycle_old.sqf +++ b/SQF/dayz_code/actions/trade_any_bicycle_old.sqf @@ -104,7 +104,8 @@ if (_qty >= _qty_in) then { }; //place vehicle spawn marker (local) - _sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location; + _sign = "Sign_arrow_down_large_EP1" createVehicleLocal [0,0,0]; + _sign setPos _location; _location = [_sign] call FNC_GetPos; [_part_out,_sign] call fn_waitForObject; diff --git a/SQF/dayz_code/actions/trade_any_boat.sqf b/SQF/dayz_code/actions/trade_any_boat.sqf index f9a056194..7e4a559d3 100644 --- a/SQF/dayz_code/actions/trade_any_boat.sqf +++ b/SQF/dayz_code/actions/trade_any_boat.sqf @@ -132,7 +132,8 @@ if (_finished) then { }; //place vehicle spawn marker (local) - _sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location; + _sign = "Sign_arrow_down_large_EP1" createVehicleLocal [0,0,0]; + _sign setPos _location; _location = [_sign] call FNC_GetPos; [_part_out,_sign] call fn_waitForObject; diff --git a/SQF/dayz_code/actions/trade_any_boat_old.sqf b/SQF/dayz_code/actions/trade_any_boat_old.sqf index 2849c83a0..df8414135 100644 --- a/SQF/dayz_code/actions/trade_any_boat_old.sqf +++ b/SQF/dayz_code/actions/trade_any_boat_old.sqf @@ -110,7 +110,8 @@ if (_qty >= _qty_in) then { }; //place vehicle spawn marker (local) - _sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location; + _sign = "Sign_arrow_down_large_EP1" createVehicleLocal [0,0,0]; + _sign setPos _location; _location = [_sign] call FNC_GetPos; [_part_out,_sign] call fn_waitForObject; diff --git a/SQF/dayz_code/actions/trade_any_vehicle.sqf b/SQF/dayz_code/actions/trade_any_vehicle.sqf index e02fc0c83..0f59f3ab4 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle.sqf @@ -131,7 +131,8 @@ if (_finished) then { }; //place vehicle spawn marker (local) - _sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location; + _sign = "Sign_arrow_down_large_EP1" createVehicleLocal [0,0,0]; + _sign setPos _location; _location = [_sign] call FNC_GetPos; [_part_out,_sign] call fn_waitForObject; diff --git a/SQF/dayz_code/actions/trade_any_vehicle_free.sqf b/SQF/dayz_code/actions/trade_any_vehicle_free.sqf index f42229071..b1f308283 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle_free.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle_free.sqf @@ -130,7 +130,8 @@ if (_finished) then { }; //place vehicle spawn marker (local) - _sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location; + _sign = "Sign_arrow_down_large_EP1" createVehicleLocal [0,0,0]; + _sign setPos _location; _location = [_sign] call FNC_GetPos; [_part_out,_sign] call fn_waitForObject; diff --git a/SQF/dayz_code/actions/trade_any_vehicle_old.sqf b/SQF/dayz_code/actions/trade_any_vehicle_old.sqf index a8e78b86b..9cbeb5a96 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle_old.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle_old.sqf @@ -117,7 +117,8 @@ if (_qty >= _qty_in) then { }; //place vehicle spawn marker (local) - _sign = "Sign_arrow_down_large_EP1" createVehicleLocal _location; + _sign = "Sign_arrow_down_large_EP1" createVehicleLocal [0,0,0]; + _sign setPos _location; _location = [_sign] call FNC_GetPos; [_part_out,_sign] call fn_waitForObject; diff --git a/SQF/dayz_code/compile/local_spawnObjects.sqf b/SQF/dayz_code/compile/local_spawnObjects.sqf index f55940bed..5e00d2e9b 100644 --- a/SQF/dayz_code/compile/local_spawnObjects.sqf +++ b/SQF/dayz_code/compile/local_spawnObjects.sqf @@ -31,7 +31,7 @@ _fires = [ { _type = _x select 0; - _object = _type createVehicleLocal (_x select 1); + _object = _type createVehicleLocal [0,0,0]; _object setDir (_x select 2); _object setPos (_x select 1); _object allowDamage false;