From 5f9a5cc31c7c893dcd84d99abf7bb444d314eaed Mon Sep 17 00:00:00 2001 From: Skaronator Date: Sat, 30 Nov 2013 23:05:32 +0100 Subject: [PATCH] Update if (ty @vos) --- SQF/dayz_server/init/server_functions.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index e4ba0625b..cfa29879f 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -230,11 +230,11 @@ spawn_vehicles = { // vehicle limit reached, remove vehicle from list // since elements cannot be removed from an array, overwrite it with the last element and cut the last element of (as long as order is not important) + _lastIndex = (count AllowedVehiclesList) - 1; if (_lastIndex != _index) then { - _lastIndex = (count AllowedVehiclesList) - 1; AllowedVehiclesList set [_index, AllowedVehiclesList select _lastIndex]; - AllowedVehiclesList resize _lastIndex; }; + AllowedVehiclesList resize _lastIndex; }; if (count AllowedVehiclesList == 0) then {