Skip to content

Commit

Permalink
RELEASE 1.7.17H.rc4
Browse files Browse the repository at this point in the history
Performance optimizations
  • Loading branch information
IrLED committed Nov 21, 2017
2 parents 4f5e109 + 9d1efb5 commit 6fc16db
Show file tree
Hide file tree
Showing 59 changed files with 543 additions and 522 deletions.
4 changes: 2 additions & 2 deletions AntistasiOfficial.Altis/AI/artySupport.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ for "_i" from 0 to (count _artyArray) - 1 do
};
};

if (count _artyArrayDef1 == 0) exitWith {hint "The position you marked is out of bounds for that Battery"};
if (_artyArrayDef1 isEqualTo []) exitWith {hint "The position you marked is out of bounds for that Battery"};

_mrkfin = createMarker [format ["Arty%1", random 100], _posicionTel];
_mrkfin setMarkerShape "ICON";
Expand Down Expand Up @@ -306,4 +306,4 @@ if (_forzado) then
forcedSpawn = forcedSpawn - [_marcador];
publicVariable "forcedSpawn";
};
};
};
6 changes: 3 additions & 3 deletions AntistasiOfficial.Altis/AI/findSafeRoadToUnload.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ if (_dif > 0) then
while {true} do
{
_roads = _destino nearRoads _tam;
if (count _roads == 0) then {_tam = _tam + 50};
if (count _roads > 0) exitWith {};
if (_roads isEqualTo []) then {_tam = _tam + 50};
if !(_roads isEqualTo []) exitWith {};
};

_road = _roads select 0;
Expand All @@ -30,4 +30,4 @@ if ((_origen distance (position _x)) < _dist) then

_result = position _road;

_result
_result
1 change: 1 addition & 0 deletions AntistasiOfficial.Altis/CREATE/VEHdespawner.sqf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
scriptName "VEHdespawner";
params ["_vehicle"];
private ["_isListed","_vehiclePos","_city","_data","_unit"];

Expand Down
4 changes: 2 additions & 2 deletions AntistasiOfficial.Altis/CREATE/civVEHinit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (_vehicle isKindOf "Car") then {
}];
};

if (count crew _vehicle == 0) then {
if ((crew _vehicle)isEqualTo []) then {
sleep 10;
_vehicle enableSimulationGlobal false;
_vehicle addEventHandler ["GetIn",{
Expand All @@ -29,4 +29,4 @@ if (count crew _vehicle == 0) then {
params ["_object"];
if (!simulationEnabled _object) then {_object enableSimulationGlobal true};
}];
};
};
6 changes: 3 additions & 3 deletions AntistasiOfficial.Altis/CREATE/combinedCA.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if (_involveCSAT) then {
_spawnPosition = _originPosition findEmptyPosition [0,100,_vehicleType];
sleep 1;
};
if (count _spawnPosition == 0) then {_spawnPosition = _originPosition};
if (_spawnPosition isEqualTo []) then {_spawnPosition = _originPosition};

_vehicleData = [_originPosition, 0, _vehicleType, side_red] call bis_fnc_spawnvehicle;
_vehicle = _vehicleData select 0;
Expand Down Expand Up @@ -259,7 +259,7 @@ if !(_airport == "") then {
_spawnPosition = _originPosition findEmptyPosition [0,100,heli_transport];
sleep 1;
};
if (count _spawnPosition == 0) then {_spawnPosition = _originPosition};
if (_spawnPosition isEqualTo []) then {_spawnPosition = _originPosition};

_vehicleData = [_spawnPosition, [_spawnPosition, _markerPos] call BIS_fnc_dirTo,_vehicleType, side_green] call bis_fnc_spawnvehicle;
_vehicle = _vehicleData select 0;
Expand Down Expand Up @@ -372,4 +372,4 @@ waitUntil {sleep 1; !(spawner getVariable _marker)};
[_allGroups + _redGroups, _allSoldiers + _redSoldiers, _allVehicles + _redVehicles] spawn AS_fnc_despawnUnits;

forcedSpawn = forcedSpawn - [_marker]; //Sparker: remove force spawn a base under attack
publicVariable "forcedSpawn";
publicVariable "forcedSpawn";
4 changes: 2 additions & 2 deletions AntistasiOfficial.Altis/CREATE/createNATOaerop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ while {(spawner getVariable _marker) AND (_counter < _maxVehicles)} do {
_groupType = [bluTeam, side_blue] call AS_fnc_pickGroup;
_group = [_spawnPos,side_blue, _groupType] call BIS_Fnc_spawnGroup;
sleep 1;
if ((count _statics > 0) and (_counter == 0)) then {
if (!(_statics isEqualTo []) and (_counter == 0)) then {
//[leader _group, _marker, "SAFE","SPAWNED","FORTIFY","NOVEH","NOFOLLOW"] execVM "scripts\UPSMON.sqf"; Stef 14/09 removed fortify for smoother attack
[leader _group, _marker, "SAFE","SPAWNED","NOVEH","NOFOLLOW"] execVM "scripts\UPSMON.sqf";
} else {
Expand Down Expand Up @@ -344,4 +344,4 @@ if (spawner getVariable _marker) then {
waitUntil {sleep 1; !(spawner getVariable _marker)};

[_allGroups + _guerGroups, _allSoldiers + _guerSoldiers, _allVehicles + _guerVehicles] spawn AS_fnc_despawnUnitsNow;
if !(isNull _observer) then {deleteVehicle _observer};
if !(isNull _observer) then {deleteVehicle _observer};
13 changes: 7 additions & 6 deletions AntistasiOfficial.Altis/CREATE/genRoadPatrol.sqf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "script_component.hpp"
scriptName "genRoadPatrol";
private ["_allVehicles","_allGroups","_allSoldiers","_base","_spawnData","_spawnPosition","_direction","_vehicleArray","_vehicleType","_arrayBases","_arrayTargets","_distance","_vehicleData","_vehicle","_groupVehicle","_beach","_group","_target","_targetPosition","_wp_v_1","_object","_knowledge"];

_allVehicles = [];
Expand All @@ -20,22 +21,22 @@ while {true} do {
_arrayBases = bases - mrkFIA;
};

if (count _arraybases == 0) then {
if (_arraybases isEqualTo []) then {
_vehicleArray = _vehicleArray - [_vehicleType];
} else {
while {true} do {
_base = [_arraybases,getMarkerPos guer_respawn] call BIS_fnc_nearestPosition;
if !(spawner getVariable _base) exitWith {};
if (spawner getVariable _base) then {_arraybases = _arraybases - [_base]};
if (count _arraybases == 0) exitWith {};
if (_arraybases isEqualTo []) exitWith {};
};
if (count _arraybases == 0) then {_vehicleArray = _vehicleArray - [_vehicleType]};
if (_arraybases isEqualTo []) then {_vehicleArray = _vehicleArray - [_vehicleType]};
};
if (count _vehicleArray == 0) exitWith {};
if (_vehicleArray isEqualTo []) exitWith {};
if !(spawner getVariable _base) exitWith {};
};

if (count _vehicleArray == 0) exitWith {};
if (_vehicleArray isEqualTo []) exitWith {};

_spawnPosition = getMarkerPos _base;

Expand Down Expand Up @@ -143,4 +144,4 @@ while {alive _vehicle} do {

AAFpatrols = AAFpatrols - 1; publicVariableServer "AAFpatrols";

[_allGroups, _allSoldiers, _allVehicles] spawn AS_fnc_despawnUnits;
[_allGroups, _allSoldiers, _allVehicles] spawn AS_fnc_despawnUnits;
8 changes: 4 additions & 4 deletions AntistasiOfficial.Altis/CREATE/mortarPos.sqf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
params ["_position"];
private ["_position","_counter","_probe","_intersec","_zi","_zf","_vel"];
private ["_counter","_probe","_intersec","_zi","_zf","_vel"];

_position = _position findEmptyPosition [1,30,"I_G_Mortar_01_F"];
if (count _position == 0) then {_position = _this select 0};
if (_position isEqualTo []) then {_position = _this select 0};

_probe = statMortar createVehicleLocal _position;
_probe setpos [_position select 0,_position select 1,(_position select 2) + 60];
Expand All @@ -21,5 +21,5 @@ while {_counter > 0} do {
};
if (_counter == 0) then {_position = (_this select 0) findEmptyPosition [1,30,"I_G_Mortar_01_F"]};
deleteVehicle _probe;
if (count _position == 0) then {_position = [0,0,0]};
_position
if (_position isEqualTo []) then {_position = [0,0,0]};
_position
6 changes: 3 additions & 3 deletions AntistasiOfficial.Altis/CREATE/patrolCA.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ if !(_airport == "") then {
_spawnPosition = _originPosition findEmptyPosition [0,100,heli_transport];
sleep 1;
};
if (count _spawnPosition == 0) then {_spawnPosition = _originPosition};
if (_spawnPosition isEqualTo []) then {_spawnPosition = _originPosition};

_vehicleData = [_spawnPosition, [_spawnPosition, _markerPos] call BIS_fnc_dirTo,_vehicleType, side_green] call bis_fnc_spawnvehicle;
_vehicle = _vehicleData select 0;
Expand Down Expand Up @@ -275,7 +275,7 @@ if (_involveCSAT) then {
_spawnPosition = _originPosition findEmptyPosition [0,100,_vehicleType];
sleep 1;
};
if (count _spawnPosition == 0) then {_spawnPosition = _originPosition};
if (_spawnPosition isEqualTo []) then {_spawnPosition = _originPosition};

_vehicleData = [_originPosition, 0, _vehicleType, side_red] call bis_fnc_spawnvehicle;
_vehicle = _vehicleData select 0;
Expand Down Expand Up @@ -340,4 +340,4 @@ if (_isMarker) then {
publicVariable "smallCApos";
};

[_allGroups + _redGroups, _allSoldiers + _redSoldiers, _allVehicles + _redVehicles] spawn AS_fnc_despawnUnits;
[_allGroups + _redGroups, _allSoldiers + _redSoldiers, _allVehicles + _redVehicles] spawn AS_fnc_despawnUnits;
4 changes: 2 additions & 2 deletions AntistasiOfficial.Altis/Functions/fn_JNA_setupGear.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
params [["_array",[],[[]]]];
private ["_className","_category","_index","_added"];

if (count _array == 0) exitWith {diag_log "Error in JNA_setupGear: empty input array"};
if (_array isEqualTo []) exitWith {diag_log "Error in JNA_setupGear: empty input array"};

{
_className = _x;
Expand All @@ -35,4 +35,4 @@ if (count _array == 0) exitWith {diag_log "Error in JNA_setupGear: empty input a
};
} forEach _array;

publicVariable "jna_dataList";
publicVariable "jna_dataList";
4 changes: 2 additions & 2 deletions AntistasiOfficial.Altis/Functions/fn_createLootCrates.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ for "_i" from 1 to 10 do {
};
};

if (count _allLocations == 0) exitWith {diag_log "CLC: no locations"};
if (_allLocations isEqualTo []) exitWith {diag_log "CLC: no locations"};

_locations = [];
if (count _allLocations > _number) then {
Expand All @@ -51,4 +51,4 @@ diag_log _locations;
_crate setDir (random 360);
[_crate] call emptyCrate;
diag_log format ["house: %1; crate: %3; cratePos: %2", position _house, _cratePosition, _crate];
} forEach _locations;
} forEach _locations;
2 changes: 1 addition & 1 deletion AntistasiOfficial.Altis/Functions/fn_expandGroup.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
params ["_group", "_position", ["_soldiers", []]];
private ["_unit"];

if (count _soldiers == 0) then {
if (_soldiers isEqualTo []) then {
_unit = _group createUnit [sol_MK, _position, [],0, "NONE"];
_unit = _group createUnit [sol_MED, _position, [],0, "NONE"];
_unit = _group createUnit [sol_ENG, _position, [],0, "NONE"];
Expand Down
4 changes: 2 additions & 2 deletions AntistasiOfficial.Altis/Functions/fn_garrisonMonitor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ params ["_marker", ["_garrison", []]];
private ["_sizeZone", "_sizeGarrison", "_markerPosition", "_break"];

if !(_marker in mrkAAF) exitWith {diag_log format ["Garrison monitor: invalid marker: %1", _marker]};
if (count _garrison == 0) exitWith {diag_log format ["Garrison monitor: invalid garrison: %1", _garrison]};
if (_garrison isEqualTo []) exitWith {diag_log format ["Garrison monitor: invalid garrison: %1", _garrison]};
if !(spawner getVariable _marker) exitWith {diag_log format ["Garrison monitor: zone is inactive: %1", _marker]};

sleep 15; // allow units to spawn in properly
Expand All @@ -28,4 +28,4 @@ sleep 2;
if (!(_marker in mrkFIA) and (_marker in reducedGarrisons)) exitWith {
diag_log format ["Garrison monitor: garrison combat ineffective: %1 -- dispatching reinforcements", _marker];
[_marker] spawn AS_fnc_reinforcementTimer;
};
};
4 changes: 2 additions & 2 deletions AntistasiOfficial.Altis/Functions/fn_groundTransport.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ if (_groupCounter > 1) then {
if !(_isArmed) then {
[_vehicleGroup, _infGroupOne, _targetPosition, _originPosition, _vehicle] spawn {
params ["_vg","_ig","_tp","_op","_veh"];
waitUntil {sleep 5; (((units _ig select 0) distance _veh > 50) AND (count assignedCargo _veh < 1)) OR ({alive _x} count units _vg == 0)};
waitUntil {sleep 5; (((units _ig select 0) distance _veh > 50) AND ((assignedCargo _veh)isEqualTo [])) OR ({alive _x} count units _vg == 0)};
[_vg, _op] spawn AS_fnc_QRF_RTB;
};
};

[_allVehicles, _allGroups, _allSoldiers]
[_allVehicles, _allGroups, _allSoldiers]
14 changes: 7 additions & 7 deletions AntistasiOfficial.Altis/Functions/fn_lootCorpses.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ _boxes = [];
};
} forEach (nearestObjects [position _unit, ["Box_IND_Wps_F"], DIS]);

if ((count _corpses == 0) && (count _boxes == 0)) exitWith {hintSilent "No corpses nearby."};
if ((_corpses isEqualTo []) && (_boxes isEqualTo [])) exitWith {hintSilent "No corpses nearby."};

_unit setVariable ["AS_lootingCorpses", true, true];
_unit setBehaviour "SAFE";
Expand Down Expand Up @@ -92,9 +92,9 @@ while {true} do {
};

_containers = nearestObjects [_unit, ["WeaponHolderSimulated", "GroundWeaponHolder", "WeaponHolder"], 10];
if (count _containers == 0) then {breakTo "outerLoop"};
if (_containers isEqualTo []) then {breakTo "outerLoop"};
_container = _containers select 0;
if (count (weaponCargo _container) > 0) then {
if !((weaponCargo _container) isEqualTo []) then {
_unit doMove (getPosATL _container);
_timeOut = time + 20;

Expand All @@ -107,9 +107,9 @@ while {true} do {
};
} else {
_containers = nearestObjects [_unit, ["WeaponHolderSimulated", "GroundWeaponHolder", "WeaponHolder"], DIS];
if (count _containers == 0) then {breakTo "main"};
if (_containers isEqualTo []) then {breakTo "main"};
_container = _containers select 0;
if (count (weaponCargo _container) > 0) then {
if !((weaponCargo _container) isEqualTo []) then {
_unit doMove (getPosATL _container);
_timeOut = time + 20;

Expand All @@ -124,7 +124,7 @@ while {true} do {
sleep 1;
};

if (count _boxes > 0) then {
if !(_boxes isEqualTo []) then {
if (_unit getVariable ["AS_cannotComply", false]) then {breakTo "main"};
while {true} do {

Expand Down Expand Up @@ -172,4 +172,4 @@ if (count _boxes > 0) then {
_unit setVariable ["AS_cannotComply", nil, true];
_unit setVariable ["AS_lootingCorpses", nil, true];
_unit stop false;
_unit doFollow player;
_unit doFollow player;
8 changes: 4 additions & 4 deletions AntistasiOfficial.Altis/Functions/fn_spawnAttack.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if ((random 100 > (server getVariable "prestigeCSAT")) or ({_x in bases} count m
_includeCSAT = false;
};

if (count _possibleTargets == 0) exitWith { diag_log format ["fn_spawnAttack.sqf: no possible targets found."];};
if (_possibleTargets isEqualTo []) exitWith {diag_log format ["fn_spawnAttack.sqf: no possible targets found."];};

_scoreLand = APCAAFcurrent + (5*tanksAAFcurrent);
_scoreAir = helisAAFcurrent + (5*planesAAFcurrent);
Expand Down Expand Up @@ -156,7 +156,7 @@ if ((count _objectives > 0) and (_difficulty < 3)) then {
};

if !("CONVOY" in misiones) then {
if (count _objectives == 0) then {
if (_objectives isEqualTo []) then {
{
_base = [_x] call AS_fnc_findBaseForConvoy;
if !(_base == "") then {
Expand All @@ -169,10 +169,10 @@ if !("CONVOY" in misiones) then {
};
} forEach (ciudades - mrkAAF);

if (count _objectives > 0) then {
if !(_objectives isEqualTo []) then {
_objective = selectRandom _objectives;
[(_objective select 0),(_objective select 1),"civ"] remoteExec ["CONVOY",HCattack];
};
};
};
diag_log format ["ObjectivE %1", _objective];
diag_log format ["ObjectivE %1", _objective];
4 changes: 2 additions & 2 deletions AntistasiOfficial.Altis/Functions/fn_vacuSuck.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ _corpses = [];
};
} forEach (entities "Man");

if (count _corpses == 0) exitWith {hintSilent "No corpses within range."};
if (_corpses isEqualTo []) exitWith {hintSilent "No corpses within range."};

_stationary = true;
[[petros,"hint","Deploying garden hoses..."],"commsMP"] call BIS_fnc_MP;
Expand Down Expand Up @@ -47,4 +47,4 @@ while {_stationary} do {
[[petros,"hint","Everyone's been sucked off, good to go."],"commsMP"] call BIS_fnc_MP;

AS_scavenging = nil;
publicVariable "AS_scavenging";
publicVariable "AS_scavenging";
4 changes: 2 additions & 2 deletions AntistasiOfficial.Altis/Missions/ASS_Mayor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ _fechalimnum = dateToNumber _fechalim;
_tam = [_initialMarker] call sizeMarker;

_houses = nearestObjects [_initialPosition, ["Land_i_House_Big_02_V3_F","Land_i_House_Big_02_V2_F","Land_i_House_Big_01_V3_F","Land_i_House_Big_01_V1_F","Land_i_House_Big_01_V2_F","Land_Shop_Town_03_F","Land_House_Big_04_F","Land_House_Small_04_F","Land_House_Big_03_F","Land_Hotel_02_F","Land_Hotel_01_F"], _tam];
if (count _houses == 0) then {_houses = nearestObjects [_initialPosition, ["house"], _tam];};
if (_houses isEqualTo []) then {_houses = nearestObjects [_initialPosition, ["house"], _tam];};
_housePositions = [];
_house = _houses select 0;
while {count _housePositions < 3} do
Expand Down Expand Up @@ -76,7 +76,7 @@ _mayorGroup selectLeader _mayor;
_posTsk = (position _house) getPos [random 100, random 360];

_spawnData = [_initialPosition, [ciudades, _initialPosition] call BIS_fnc_nearestPosition] call AS_fnc_findRoadspot;
if (count _spawnData < 1) exitWith {diag_log format ["Error in traitor: no suitable roads found near %1",_initialMarker]};
if (_spawnData isEqualTo []) exitWith {diag_log format ["Error in traitor: no suitable roads found near %1",_initialMarker]};
_roadPos = _spawnData select 0;
_roadDir = _spawnData select 1;

Expand Down
13 changes: 6 additions & 7 deletions AntistasiOfficial.Altis/Missions/AS_Mayor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ _fechalimnum = dateToNumber _fechalim;
_tam = [_initialMarker] call sizeMarker;

_houses = nearestObjects [_initialPosition, ["Land_i_House_Big_02_V3_F","Land_i_House_Big_02_V2_F","Land_i_House_Big_01_V3_F","Land_i_House_Big_01_V1_F","Land_i_House_Big_01_V2_F","Land_Shop_Town_03_F","Land_House_Big_04_F","Land_House_Small_04_F","Land_House_Big_03_F","Land_Hotel_02_F","Land_Hotel_01_F"], _tam];
if (count _houses == 0) then {_houses = nearestObjects [_initialPosition, ["house"], _tam];};
if (_houses isEqualTo []) then {_houses = nearestObjects [_initialPosition, ["house"], _tam];};
_housePositions = [];
_house = _houses select 0;
while {count _housePositions < 3} do
{
_house = _houses call BIS_Fnc_selectRandom;
_housePositions = [_house] call BIS_fnc_buildingPositions;
if (count _housePositions < 3) then {_houses = _houses - [_house]};
};
while {count _housePositions < 3} do{
_house = _houses call BIS_Fnc_selectRandom;
_housePositions = [_house] call BIS_fnc_buildingPositions;
if (count _housePositions < 3) then {_houses = _houses - [_house]};
};

_max = (count _housePositions) - 1;
_rnd = floor random _max;
Expand Down
Loading

0 comments on commit 6fc16db

Please sign in to comment.