mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Update Private Vars (ty @vos)
This commit is contained in:
@@ -211,7 +211,7 @@ BuildingList = [];
|
|||||||
} forEach (MarkerPosition nearObjects ["building",DynamicVehicleArea]);
|
} forEach (MarkerPosition nearObjects ["building",DynamicVehicleArea]);
|
||||||
|
|
||||||
spawn_vehicles = {
|
spawn_vehicles = {
|
||||||
private ["_weights","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_marker","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots"];
|
private ["_random","_lastIndex","_weights","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_marker","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots"];
|
||||||
|
|
||||||
if (isDedicated) then {
|
if (isDedicated) then {
|
||||||
|
|
||||||
@@ -230,10 +230,12 @@ spawn_vehicles = {
|
|||||||
|
|
||||||
// vehicle limit reached, remove vehicle from list
|
// 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)
|
// 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)
|
||||||
|
if (_lastIndex != _index) then {
|
||||||
_lastIndex = (count AllowedVehiclesList) - 1;
|
_lastIndex = (count AllowedVehiclesList) - 1;
|
||||||
AllowedVehiclesList set [_index, AllowedVehiclesList select _lastIndex];
|
AllowedVehiclesList set [_index, AllowedVehiclesList select _lastIndex];
|
||||||
AllowedVehiclesList resize _lastIndex;
|
AllowedVehiclesList resize _lastIndex;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
if (count AllowedVehiclesList == 0) then {
|
if (count AllowedVehiclesList == 0) then {
|
||||||
diag_log("DEBUG: unable to find suitable vehicle to spawn");
|
diag_log("DEBUG: unable to find suitable vehicle to spawn");
|
||||||
|
|||||||
Reference in New Issue
Block a user