diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/cache/find_pos.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/cache/find_pos.sqf index ecb81ab30..a3dc5f9df 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/cache/find_pos.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/cache/find_pos.sqf @@ -3,9 +3,8 @@ private ["_useful","_house","_id","_city","_xx","_y","_pos","_houses","_house"]; if (count btc_hideouts == 0) exitWith {}; -_useful = []; _house = objNull; -{if (_x getVariable ["occupied",false] && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"} && {_x getVariable ["type",""] != "NameMarine"}) then {_useful = _useful + [_x];};} foreach btc_city_all; +_useful = btc_city_all select {(_x getVariable ["occupied",false] && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"} && {_x getVariable ["type",""] != "NameMarine"})}; if (count _useful == 0) then {_useful = btc_city_all;}; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf index 4ffeb11f1..7683a84d2 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf @@ -14,10 +14,8 @@ if ({_x distance _city < (_area/2) || _x distance leader _group < (_area/2)} cou {deleteVehicle _x;} foreach units _group;deleteGroup _group; }; -_cities = []; -{if (((_x distance _city < _area) && !_iswater && {_x getVariable ["type",""] != "NameMarine"}) || ((_x distance _city < _area*2) && _iswater && {_x getVariable ["type",""] == "NameMarine"})) then { - _cities = _cities + [_x]; -};} foreach btc_city_all; +_cities = btc_city_all select {(((_x distance _city < _area) && !_iswater && {_x getVariable ["type",""] != "NameMarine"}) || ((_x distance _city < _area*2) && _iswater && {_x getVariable ["type",""] == "NameMarine"}))}; + _pos = []; if (count _cities == 0) then {_pos = getPos _city;} else { _pos = getPos (_cities select (floor random count _cities)); diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf index 5ca19e6e0..32cd1893b 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf @@ -1,28 +1,24 @@ -private ["_city","_area","_cities","_useful","_unit_type","_veh_type","_group","_veh","_iswater"]; +private ["_city","_area","_cities","_useful","_unit_type","_veh_type","_group","_veh","_iswater","_pos"]; _city = _this select 0; _area = _this select 1; if (isNil "btc_traffic_id") then {btc_traffic_id = 0;}; -_cities = []; -{if (_x distance _city < _area) then {_cities = _cities + [_x];};} foreach btc_city_all; -_useful = []; -{ - if !(_x getVariable ["active",false]) then {_useful = _useful + [getPos _x];}; -} foreach _cities; - -if (count _useful == 0) then { - while {count _useful == 0} do { +_cities = btc_city_all select {(_x distance _city < _area)}; +_useful = _cities select {!(_x getVariable ["active",false])}; +if (_useful isEqualTo []) then { + while {_useful isEqualTo []} do { private "_pos"; _pos = [getPos _city, _area, true] call btc_fnc_randomize_pos; - if ({_x distance _pos < 500} count playableUnits == 0) then {_useful = _useful + [_pos];}; + if ({_x distance _pos < 500} count playableUnits == 0) then {_useful pushBack _pos;}; }; + _pos = selectRandom _useful; +} else { + _pos = getpos(_useful select (floor random count _useful)); }; -_pos = _useful select (floor random count _useful); - _unit_type = btc_civ_type_units select (floor random count btc_civ_type_units); _veh_type = btc_civ_type_veh select (floor (random (count btc_civ_type_veh))); @@ -34,7 +30,7 @@ _group setVariable ["city",_city]; _Spos = []; if (count (_pos nearRoads 100) > 0) then { - _Spos = getPos ((_pos nearRoads 500) select 0) + _Spos = getPos ((_pos nearRoads 500) select 0); } else { _Spos = [_pos, 0, 500, 13, 1, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; }; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/final_phase.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/final_phase.sqf index 90ce029aa..7a205e627 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/final_phase.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/final_phase.sqf @@ -17,12 +17,12 @@ btc_city_remaining = []; _marker setMarkerBrush "SolidBorder"; _marker setMarkerSize [(_radius_x+_radius_y), (_radius_x+_radius_y)]; _marker setMarkerAlpha 0.3; - if (_x getVariable ["occupied",false]) then {_marker setmarkercolor "colorRed";btc_city_remaining = btc_city_remaining + [_x];} else {_marker setmarkercolor "colorGreen";_marker setMarkerAlpha 0;}; + if (_x getVariable ["occupied",false]) then {_marker setmarkercolor "colorRed";btc_city_remaining pushBack _x;} else {_marker setmarkercolor "colorGreen";_marker setMarkerAlpha 0;}; _x setVariable ["marker",_marker]; }; } foreach btc_city_all; -waitUntil {sleep 15; (count btc_city_remaining == 0)}; +waitUntil {sleep 15; (btc_city_remaining isEqualTo [])}; [0,"btc_fnc_task_set_done",true,true] spawn BIS_fnc_MP; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/getHouses.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/getHouses.sqf index 2c340f037..668715620 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/getHouses.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/getHouses.sqf @@ -1,11 +1,5 @@ _pos = _this select 0; _radius = _this select 1; _buildings = nearestObjects [_pos, ["Building"], _radius]; -_useful = []; -{ - if (format["%1", _x buildingPos 2] != "[0,0,0]" && {damage _x == 0} && {isNil {_x getVariable "btc_house_taken"}}) then - { - _useful set [count _useful, _x]; - }; -} forEach _buildings; -_useful \ No newline at end of file +_useful = _buildings select {(format["%1", _x buildingPos 2] != "[0,0,0]" && {damage _x == 0} && {isNil {_x getVariable "btc_house_taken"}})}; +_useful \ No newline at end of file diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/marker_debug.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/marker_debug.sqf index 7d7cc1bfb..118fdc9e9 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/marker_debug.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/marker_debug.sqf @@ -11,7 +11,7 @@ _color = "";_markers = []; switch (true) do {case (side _x == west) : {_color = "ColorBlue"};case (side _x == east) : {_color = "ColorRed"};case (side _x == independent) : {_color = "ColorGreen"}; default {_color = "ColorWhite"};}; format ["%1", _x] setmarkerColorlocal _color; format ["%1", _x] setMarkerSizeLocal [0.7, 0.7]; - _markers = _markers + [_marker]; + _markers pushBack _marker; }; } foreach _units; player sideChat format ["UNITS:%1 - GROUPS:%2", count allunits, count allgroups]; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/data/add_group.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/data/add_group.sqf index 0c06e56f6..8f01fb7a2 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/data/add_group.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/data/add_group.sqf @@ -48,6 +48,6 @@ if !(_city getVariable ["active",false]) then if (btc_final_phase) then { - btc_city_remaining = btc_city_remaining + [_city]; + btc_city_remaining pushBack _city; }; diag_log format ["END = %1",[]]; \ No newline at end of file diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/data/get_group.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/data/get_group.sqf index c28d2e877..9fd81eff1 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/data/get_group.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/data/get_group.sqf @@ -36,7 +36,7 @@ if (!isNil {_group getVariable "getWeapons"}) then {_type_db = 5;}; if (vehicle leader _group != leader _group) then {_type_db = 1;}; -if (_type_db == 1) then +if (_type_db == 1) then { private ["_veh"]; _veh = vehicle leader _group; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/fob/create.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/fob/create.sqf index 14addd846..7a206bea9 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/fob/create.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/fob/create.sqf @@ -27,7 +27,7 @@ _name = ctrlText 777; _name_to_check = ("FOB " + (toUpper(_name))); _array_markers = []; -{private "_n";_n = toUpper(_x);_array_markers = _array_markers + [_n];} foreach allMapMarkers; +{private "_n";_n = toUpper(_x);_array_markers pushBack _n;} foreach allMapMarkers; if (_array_markers find _name_to_check >= 0) exitWith {closeDialog 0;hint "Name already in use!";_mat spawn btc_fnc_fob_create;}; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/ied/fired_near.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/ied/fired_near.sqf index b14e6ef02..94d15957d 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/ied/fired_near.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/ied/fired_near.sqf @@ -2,7 +2,7 @@ _pos = getPos _this; _pos = [_pos select 0, _pos select 1, (_pos select 2) + 0.5]; _range = 2; -_bomb_check = +_bomb_check = { _ied = _this select 0; _bomb = _this select 1; @@ -13,21 +13,21 @@ _bomb_check = _array = []; -while {alive _this && !isNull _this && _this getVariable ["active",false]} do +while {alive _this && !isNull _this && _this getVariable ["active",false]} do { _list = _pos nearObjects ["Default",_range]; - if (count _list > 0) then + if (count _list > 0) then { { private "_bullet"; _b = _x; _bullet = typeOf _b; if ({_bullet isKindOf _x} count ["SmokeShell", "FlareCore", "IRStrobeBase", "GrenadeHand_stone", "Smoke_120mm_AMOS_White", "TMR_R_DG32V_F"] > 0) exitWith {}; - if ({_bullet isKindOf _x} count ["TimeBombCore","BombCore", "Grenade"] > 0) then + if ({_bullet isKindOf _x} count ["TimeBombCore","BombCore", "Grenade"] > 0) then { if !(_b in _array) then { - _array = _array + [_b]; + _array pushBack _b; [_this,_b] spawn _bomb_check; }; } diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/check_cap.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/check_cap.sqf index be42cd736..26d7d36bd 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/check_cap.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/check_cap.sqf @@ -5,39 +5,32 @@ if (btc_hideout_cap_checking) exitWith {}; btc_hideout_cap_checking = true; -_cap_to = []; +_cap_to = btc_hideouts select {(time - (_x getVariable ["cap_time",time]) > btc_hideout_cap_time)}; -{ - //_hd = _x; - //if ({_x distance _hd < 700} count playableUnits > 0) exitWith {}; - if (time - (_x getVariable ["cap_time",time]) > btc_hideout_cap_time) then {_cap_to = _cap_to + [_x];}; -} foreach btc_hideouts; - -if (count _cap_to == 0) exitWith {if (btc_debug_log) then {diag_log "btc_fnc_mil_check_cap: exit cap time";};}; +if (_cap_to isEqualTo []) exitWith {if (btc_debug_log) then {diag_log "btc_fnc_mil_check_cap: exit cap time";};}; { private ["_hd","_in_range"]; _hd = _x; - _in_range = []; - {if (_hd distance _x < btc_hideout_range) then {_in_range = _in_range + [_x];};} foreach btc_city_all; - - if (count _in_range == 0) exitWith {if (btc_debug_log) then {diag_log format ["btc_fnc_mil_check_cap: exit no in range = %1",_hd getVariable "id"];};}; - + _in_range = btc_city_all select {(_hd distance _x < btc_hideout_range)}; + + if (_in_range isEqualTo []) exitWith {if (btc_debug_log) then {diag_log format ["btc_fnc_mil_check_cap: exit no in range = %1",_hd getVariable "id"];};}; + private ["_closest","_dist","_pos"]; - + _closest = objNull; _dist = 999999; _pos = getPos _hd; {if (_x distance _pos < _dist && {!(_x getVariable ["occupied",false])}) then {_closest = _x;_dist = _x distance _pos;};} foreach _in_range; - + if (btc_debug_log) then {diag_log format ["btc_fnc_mil_check_cap: _in_range = %1",_in_range];}; - + if (isNull _closest) exitWith {if (btc_debug_log) then {diag_log format ["btc_fnc_mil_check_cap: exit null _closest = %1",_hd getVariable "id"];};}; - + if (btc_debug_log) then {diag_log format ["btc_fnc_mil_check_cap: SEND FROM = %1 TO %2 [int %3]",_hd getVariable "id",_closest getVariable ["name","error"],_closest getVariable ["initialized",false]];}; - + _hd setVariable ["cap_time",time]; - + if (_closest getVariable ["initialized",false]) then { /*[_hd,_closest,1,"I_Truck_02_transport_F"] spawn btc_fnc_mil_send; sleep 1; @@ -45,7 +38,7 @@ if (count _cap_to == 0) exitWith {if (btc_debug_log) then {diag_log "btc_fnc_mil sleep 1;*/ for "_i" from 0 to (2 + (round random 3)) do {[_hd,_closest,0] call btc_fnc_mil_send;}; } else {_closest setVariable ["occupied",true];if (btc_debug) then {(format ["loc_%1",_closest getVariable "id"]) setMarkerColor "ColorRed";};}; - + } foreach _cap_to; btc_hideout_cap_checking = false; \ No newline at end of file diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/check_rinf.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/check_rinf.sqf index ddab78f52..76da86f7d 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/check_rinf.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/check_rinf.sqf @@ -5,18 +5,16 @@ _city = objNull; if (count _this > 0) then {_city = _this;} else { private ["_useful","_id"]; - _useful = []; //"NameVillage","NameCity","NameCityCapital","NameLocal","Hill" - { - if ( + _useful = btc_city_all select {( !(_x getVariable ["active",false]) && {_x distance (getMarkerPos btc_respawn_marker) > btc_hideout_safezone} && {!(_x getVariable ["has_ho",false])} && ( _x getVariable ["type",""] == "NameLocal" || {_x getVariable ["type",""] == "Hill"} || {_x getVariable ["type",""] == "NameVillage"} ) - ) then {_useful = _useful + [_x];}; - } foreach btc_city_all; + ) + }; _id = floor random count _useful; _city = _useful select _id; }; @@ -53,4 +51,4 @@ if (btc_debug) then { if (btc_debug_log) then {diag_log format ["btc_fnc_mil_create_hideout: _this = %1 ; POS %2 ID %3",_this,_pos,btc_hideouts_id];}; btc_hideouts_id = btc_hideouts_id + 1; -btc_hideouts = btc_hideouts + [_hideout]; \ No newline at end of file +btc_hideouts pushBack _hideout; \ No newline at end of file diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_hideout.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_hideout.sqf index cdb57d176..e7878fc61 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_hideout.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_hideout.sqf @@ -5,10 +5,8 @@ _city = objNull; if (count _this > 0) then {_city = _this;} else { private ["_useful","_id"]; - _useful = []; - { - //"NameVillage","NameCity","NameCityCapital","NameLocal","Hill" - if ( + //"NameVillage","NameCity","NameCityCapital","NameLocal","Hill" + _useful = btc_city_all select {( !(_x getVariable ["active",false]) && {_x distance (getMarkerPos btc_respawn_marker) > btc_hideout_safezone} && {!(_x getVariable ["has_ho",false])} && @@ -17,8 +15,7 @@ if (count _this > 0) then {_city = _this;} else { {_x getVariable ["type",""] == "Hill"} || {_x getVariable ["type",""] == "NameVillage"} ) - ) then {_useful = _useful + [_x];}; - } foreach btc_city_all; + )}; _id = floor random count _useful; _city = _useful select _id; }; @@ -59,6 +56,6 @@ if (btc_debug) then { if (btc_debug_log) then {diag_log format ["btc_fnc_mil_create_hideout: _this = %1 ; POS %2 ID %3",_this,_pos,btc_hideouts_id];}; btc_hideouts_id = btc_hideouts_id + 1; -btc_hideouts = btc_hideouts + [_hideout]; +btc_hideouts pushBack _hideout; true \ No newline at end of file diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_addWP.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_addWP.sqf index f10372c06..22c205d1c 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_addWP.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_addWP.sqf @@ -13,10 +13,7 @@ if ({_x distance _city < (_area/2) || _x distance leader _group < (_area/2)} cou {deleteVehicle _x;} foreach units _group;deleteGroup _group; }; -_cities = []; -{if (((_x distance _city < _area) && !_iswater && {_x getVariable ["type",""] != "NameMarine"}) || ((_x distance _city < _area*2) && _iswater && {_x getVariable ["type",""] == "NameMarine"})) then { - _cities = _cities + [_x]; -};} foreach btc_city_all; +_cities = btc_city_all select {(((_x distance _city < _area) && !_iswater && {_x getVariable ["type",""] != "NameMarine"}) || ((_x distance _city < _area*2) && _iswater && {_x getVariable ["type",""] == "NameMarine"}))}; _pos = []; if (count _cities == 0) then {_pos = getPos _city;} else { _pos = getPos (_cities select (floor random count _cities)); diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf index 230a1ab0d..5e405dbc3 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf @@ -19,10 +19,8 @@ if (_random == 0) then { case (_n > 96) : {_random = 4;}; }; }; -_cities = []; -{if (_x distance _city < _area) then {_cities = _cities + [_x];};} foreach btc_city_all; -_useful = []; -{if (!(_x getVariable ["active",false]) && _x getVariable ["occupied",false]) then {_useful = _useful + [getPos _x];};} foreach _cities; +_cities = btc_city_all select {(_x distance _city < _area)}; +_useful = _cities select {(!(_x getVariable ["active",false]) && _x getVariable ["occupied",false])}; /* if (count _useful == 0) then { @@ -36,7 +34,7 @@ if (count _useful == 0) then { if (count _useful == 0) exitWith {true}; -_pos = _useful select (floor random count _useful); +_pos = getpos(_useful select (floor random count _useful)); _group = createGroup btc_enemy_side; _group setVariable ["city",_city]; @@ -64,7 +62,7 @@ switch (true) do { private ["_veh_type","_newZone","_veh","_cargo"]; _newZone = []; if (count (_pos nearRoads 150) > 0) then { - _newZone = getPos ((_pos nearRoads 150) select 0) + _newZone = getPos ((_pos nearRoads 150) select 0); } else { _newZone = [_pos, 0, 500, 13, 1, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; }; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf index d3fb1c3e5..80a3fcc74 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf @@ -2,9 +2,8 @@ private ["_useful","_city","_pos","_road","_roads","_boxes","_marker","_markers","_statics","_tower_type","_tower","_direction","_type_barrel","_type_canister","_type_pallet","_type_box","_btc_composition_checkpoint"]; //// Choose an occupied City \\\\ -_useful = []; -{if (_x getVariable ["occupied",false] && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine")) then {_useful = _useful + [_x];};} foreach btc_city_all; -if (count _useful == 0) exitWith {[] spawn btc_fnc_side_create;}; +_useful = btc_city_all select {(_x getVariable ["occupied",false] && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine"))}; +if (_useful isEqualTo []) exitWith {[] spawn btc_fnc_side_create;}; _city = _useful select (floor random count _useful); _pos = getPos _city; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf index f572d1686..0151fc042 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf @@ -2,9 +2,8 @@ private ["_useful","_veh","_vehpos","_city","_pos","_r","_houses","_roads","_marker","_unit_type","_fx","_phone_type"]; //// Choose a clear City \\\\ -_useful = []; -{if (!(_x getVariable ["occupied",false]) && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine")) then {_useful = _useful + [_x];};} foreach btc_city_all; -if (count _useful == 0) exitWith {[] spawn btc_fnc_side_create;}; +_useful = btc_city_all select {(!(_x getVariable ["occupied",false]) && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine"))}; +if (_useful isEqualTo []) exitWith {[] spawn btc_fnc_side_create;}; _city = _useful select (floor random count _useful); _pos = getPos _city; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/get_city.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/get_city.sqf index 0413cfee3..0748f8fb0 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/get_city.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/get_city.sqf @@ -1,10 +1,8 @@ private ["_useful","_city","_pos"]; -_useful = []; -{if (_x getVariable ["occupied",false] && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine")) then {_useful = _useful + [_x];};} foreach btc_city_all; - -if (count _useful == 0) exitWith {[] spawn btc_fnc_side_create;}; +_useful = btc_city_all select {((_x getVariable ["occupied",false]) && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"} && {_x getVariable ["type",""] != "NameMarine"})}; +if (_useful isEqualTo []) exitWith {[] spawn btc_fnc_side_create;}; _city = _useful select (floor random count _useful); diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/mines.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/mines.sqf index 05923e6db..22e5fb3d0 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/mines.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/mines.sqf @@ -1,10 +1,9 @@ private ["_useful","_city","_pos","_area","_marker","_mines"]; -_useful = []; -{if (_x getVariable ["type",""] != "NameLocal" && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine")) then {_useful = _useful + [_x];};} foreach btc_city_all; +_useful = btc_city_all select {((_x getVariable ["type",""] != "NameLocal") && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine"))}; -if (count _useful == 0) then {_useful = + btc_city_all;}; +if (_useful isEqualTo []) then {_useful = + btc_city_all;}; _city = _useful select (floor random count _useful); diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/supply.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/supply.sqf index 3aa0eaafc..d57ddf9a5 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/supply.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/supply.sqf @@ -1,10 +1,9 @@ private ["_useful","_city","_pos","_area","_marker"]; -_useful = []; -{if (_x getVariable ["type",""] != "NameLocal" && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine")) then {_useful = _useful + [_x];};} foreach btc_city_all; +_useful = btc_city_all select {(_x getVariable ["type",""] != "NameLocal" && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine"))} ; -if (count _useful == 0) then {_useful = + btc_city_all;}; +if (_useful isEqualTo []) then {_useful = + btc_city_all;}; _city = _useful select (floor random count _useful); diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf index 720611d43..019f2a504 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf @@ -1,10 +1,9 @@ private ["_useful","_city","_pos","_road","_roads","_marker","_statics","_tower_type","_tower","_direction"]; -_useful = []; -{if (_x getVariable ["occupied",false] && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine")) then {_useful = _useful + [_x];};} foreach btc_city_all; +_useful = btc_city_all select {(_x getVariable ["occupied",false] && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine"))}; -if (count _useful == 0) exitWith {[] spawn btc_fnc_side_create;}; +if (_useful isEqualTo []) exitWith {[] spawn btc_fnc_side_create;}; _city = _useful select (floor random count _useful); diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/vehicle.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/vehicle.sqf index b7e80fb58..6f15923cf 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/vehicle.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/vehicle.sqf @@ -1,9 +1,8 @@ private ["_city","_pos","_roads","_marker","_veh_type","_veh","_useful"]; -_useful = []; -{if (_x getVariable ["type",""] == "NameMarine") then {_useful = _useful + [_x];};} foreach btc_city_all; -if (count _useful == 0) exitWith {[] spawn btc_fnc_side_create;}; +_useful = btc_city_all select {(_x getVariable ["type",""] == "NameMarine")} ; +if (_useful isEqualTo []) exitWith {[] spawn btc_fnc_side_create;}; _city = _useful select (floor random count _useful); _pos = [getPos _city, 100] call btc_fnc_randomize_pos; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm b/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm index a36088ab3..766edf530 100644 Binary files a/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm and b/=BTC=co@30_Hearts_and_Minds.Altis/mission.sqm differ