mirror of
https://github.com/IT07/a3_vemf_reloaded.git
synced 2024-08-30 16:52:11 +00:00
Code polishing
This commit is contained in:
parent
ca1b11e1f8
commit
af16ee385c
@ -7,7 +7,7 @@
|
||||
|
||||
VEMFrMissionCount = VEMFrMissionCount + 1;
|
||||
_missionName = param [0, "", [""]];
|
||||
if isNil"VEMFrAttackCount" then { VEMFrAttackCount = 0 };
|
||||
if isNil "VEMFrAttackCount" then { VEMFrAttackCount = 0 };
|
||||
VEMFrAttackCount = VEMFrAttackCount + 1;
|
||||
if (VEMFrAttackCount <= ([[_missionName],["maxAttacks"]] call VEMFr_fnc_getSetting select 0)) then
|
||||
{
|
||||
@ -37,7 +37,7 @@ if (VEMFrAttackCount <= ([[_missionName],["maxAttacks"]] call VEMFr_fnc_getSetti
|
||||
_attackedFlags pushBack _flagToAttack;
|
||||
_flagPos = position _flagToAttack;
|
||||
_nearestPlayer = selectRandom (nearestObjects [_flagPos, ["Exile_Unit_Player"], 150]);
|
||||
if not isNil"_nearestPlayer" then
|
||||
if not isNil "_nearestPlayer" then
|
||||
{
|
||||
_flagName = _flagToAttack getVariable ["exileterritoryname", "ERROR: UNKNOWN NAME"];
|
||||
_paraGroups = [_flagPos, _aiSetup select 0, _aiSetup select 1, ([[_missionName],["aiMode"]] call VEMFr_fnc_getSetting select 0), _missionName, 1000 + (random 1000), 150] call VEMFr_fnc_spawnVEMFrAI;
|
||||
@ -67,7 +67,7 @@ if (VEMFrAttackCount <= ([[_missionName],["maxAttacks"]] call VEMFr_fnc_getSetti
|
||||
{
|
||||
_units pushback _x;
|
||||
} forEach (units _x);
|
||||
_signed = [_x] call VEMFr_fnc_signAI;
|
||||
[_x] ExecVM "exile_vemf_reloaded\sqf\signAI.sqf";
|
||||
} forEach _paraGroups;
|
||||
_players = nearestObjects [_flagPos, ["Exile_Unit_Player"], 275];
|
||||
[[-1, "NEW BASE ATTACK", format["A para team is on the way to %1 @ %2's location!", _flagName, name _nearestPlayer]], _players] ExecVM "exile_vemf_reloaded\sqf\broadcast.sqf";
|
||||
|
@ -12,27 +12,24 @@
|
||||
nothing
|
||||
*/
|
||||
|
||||
[] spawn
|
||||
{
|
||||
uiNamespace setVariable ["VEMFrHcLoad", []];
|
||||
uiNamespace setVariable ["VEMFrAIgroups", []];
|
||||
while {true} do
|
||||
{
|
||||
_groups = uiNamespace getVariable "VEMFrAIgroups";
|
||||
waitUntil { uiSleep 1; count _groups > 0 };
|
||||
{
|
||||
if (local _x) then
|
||||
uiNamespace setVariable ["VEMFrHcLoad", []];
|
||||
uiNamespace setVariable ["VEMFrAIgroups", []];
|
||||
while {true} do
|
||||
{
|
||||
_groups = uiNamespace getVariable "VEMFrAIgroups";
|
||||
waitUntil {if (count _groups > 0) then {true} else {uiSleep 1; false} };
|
||||
{
|
||||
if (local _x) then
|
||||
{
|
||||
if ((count units _x) < 1) then
|
||||
{
|
||||
deleteGroup _x;
|
||||
};
|
||||
if (count (units _x) > 0) then
|
||||
{
|
||||
// Group still has units, check if there is anyone that can be the owner
|
||||
[_x] call VEMFr_fnc_transferOwner;
|
||||
};
|
||||
if ((count units _x) < 1) then
|
||||
{
|
||||
deleteGroup _x;
|
||||
};
|
||||
if (count (units _x) > 0) then
|
||||
{
|
||||
// Group still has units, check if there is anyone that can be the owner
|
||||
[_x] ExecVM "exile_vemf_reloaded\sqf\transferOwner.sqf";
|
||||
};
|
||||
};
|
||||
} forEach _groups;
|
||||
};
|
||||
};
|
||||
} forEach _groups;
|
||||
};
|
||||
|
@ -84,7 +84,7 @@ if not(isNull _target AND isNull _killer) then
|
||||
if _distanceOk then
|
||||
{
|
||||
_curRespect = _killer getVariable ["ExileScore", nil];
|
||||
if not(isNil"_curRespect") then
|
||||
if not(isNil "_curRespect") then
|
||||
{
|
||||
_respectToGive = (((_message select 0) select 1) select 1);
|
||||
_newRespect = _curRespect + _respectToGive + _respectReward;
|
||||
|
@ -24,7 +24,7 @@ if (_minNew > -1) then
|
||||
{
|
||||
_minFps = "minServerFPS" call VEMFr_fnc_getSetting;
|
||||
_minPlayers = "minPlayers" call VEMFr_fnc_getSetting;
|
||||
if isNil"VEMFrForceStart" then { VEMFrForceStart = false };
|
||||
if isNil "VEMFrForceStart" then { VEMFrForceStart = false };
|
||||
waitUntil { if ([_minPlayers] call VEMFr_fnc_playerCount AND diag_fps > _minFps OR VEMFrForceStart) then { true } else { uiSleep 5; false } };
|
||||
if VEMFrForceStart then
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user