From 2f96052cddfd5e2af42614471b59bc70edb6a1a4 Mon Sep 17 00:00:00 2001 From: Teh Dango Date: Tue, 15 Mar 2016 20:45:16 -0500 Subject: [PATCH] Hotfix Bad spawn method used in the spawn file. --- sarge/SAR_AI_spawn.sqf | 163 +++++++++++++---------------------------- 1 file changed, 49 insertions(+), 114 deletions(-) diff --git a/sarge/SAR_AI_spawn.sqf b/sarge/SAR_AI_spawn.sqf index 4f7b878..9f4d5c0 100644 --- a/sarge/SAR_AI_spawn.sqf +++ b/sarge/SAR_AI_spawn.sqf @@ -51,124 +51,59 @@ _grps_sold = _valuearray select 4; _grps_surv = _valuearray select 5; _grps_upd = []; -if (SAR_HC) then { +//for [{_i = (count _grps_band)},{_i < (_max_grps select 0)}, {_i=_i+1}] do +for "_i" from (count _grps_band) to ((_max_grps select 0) - 1) do +{ + if(_max_p_grp select 0 > 0) then { + _probability = _rnd_grps select 0; + _chance = (random 100); + if(_chance < _probability) then { + _snipers=floor (random ((_max_p_grp select 0)-1)); + _soldiers =((_max_p_grp select 0)-1) - _snipers; + _group = [_markername,3,_snipers,_soldiers,"",_respawn] call SAR_AI; + _grps_upd set [count _grps_upd,_group]; + // update AI monitor + _check = [["grps_band"],[_grps_upd],_markername] call SAR_AI_mon_upd; + }; + }; +}; - if (!isServer && !hasInterface) then { - - _grps_upd = _grps_band; - - //for [{_i = (count _grps_band)},{_i < (_max_grps select 0)}, {_i=_i+1}] do - for "_i" from (count _grps_band) to ((_max_grps select 0) - 1) do - { - if(_max_p_grp select 0 > 0) then { - _probability = _rnd_grps select 0; - _chance = (random 100); - if(_chance < _probability) then { - _snipers=floor (random ((_max_p_grp select 0)-1)); - _soldiers =((_max_p_grp select 0)-1) - _snipers; - _group = [_markername,3,_snipers,_soldiers,"",_respawn] call SAR_AI; - _grps_upd set [count _grps_upd,_group]; - // update AI monitor - _check = [["grps_band"],[_grps_upd],_markername] call SAR_AI_mon_upd; - }; - }; - }; +_grps_upd = _grps_sold; - _grps_upd = _grps_sold; +//for [{_i = (count _grps_sold)},{_i < (_max_grps select 1)}, {_i=_i+1}] do +for "_i" from (count _grps_sold) to ((_max_grps select 1) - 1) do +{ + if(_max_p_grp select 1 > 0) then { + _probability = _rnd_grps select 1; + _chance = (random 100); + if(_chance < _probability) then { + _snipers=floor (random ((_max_p_grp select 1)-1)); + _soldiers =((_max_p_grp select 1)-1) - _snipers; + _group = [_markername,1,_snipers,_soldiers,"",_respawn] call SAR_AI; + _grps_upd set [count _grps_upd,_group]; + // update AI monitor + _check = [["grps_sold"],[_grps_upd],_markername] call SAR_AI_mon_upd; + }; + }; +}; - //for [{_i = (count _grps_sold)},{_i < (_max_grps select 1)}, {_i=_i+1}] do - for "_i" from (count _grps_sold) to ((_max_grps select 1) - 1) do - { - if(_max_p_grp select 1 > 0) then { - _probability = _rnd_grps select 1; - _chance = (random 100); - if(_chance < _probability) then { - _snipers=floor (random ((_max_p_grp select 1)-1)); - _soldiers =((_max_p_grp select 1)-1) - _snipers; - _group = [_markername,1,_snipers,_soldiers,"",_respawn] call SAR_AI; - _grps_upd set [count _grps_upd,_group]; - // update AI monitor - _check = [["grps_sold"],[_grps_upd],_markername] call SAR_AI_mon_upd; - }; - }; - }; +_grps_upd = _grps_surv; - _grps_upd = _grps_surv; - - //for [{_i = (count _grps_surv)},{_i < (_max_grps select 2)}, {_i=_i+1}] do - for "_i" from (count _grps_surv) to ((_max_grps select 2) - 1) do - { - if(_max_p_grp select 2 > 0) then { - _probability = _rnd_grps select 2; - _chance = (random 100); - if(_chance < _probability) then { - _snipers=floor (random ((_max_p_grp select 2)-1)); - _soldiers =((_max_p_grp select 2)-1) - _snipers; - _group = [_markername,2,_snipers,_soldiers,"",_respawn] call SAR_AI; - _grps_upd set [count _grps_upd,_group]; - // update AI monitor - _check = [["grps_surv"],[_grps_upd],_markername] call SAR_AI_mon_upd; - }; - }; - }; - }; -} else { - if (isServer) then { - //for [{_i = (count _grps_band)},{_i < (_max_grps select 0)}, {_i=_i+1}] do - for "_i" from (count _grps_band) to ((_max_grps select 0) - 1) do - { - if(_max_p_grp select 0 > 0) then { - _probability = _rnd_grps select 0; - _chance = (random 100); - if(_chance < _probability) then { - _snipers=floor (random ((_max_p_grp select 0)-1)); - _soldiers =((_max_p_grp select 0)-1) - _snipers; - _group = [_markername,3,_snipers,_soldiers,"",_respawn] call SAR_AI; - _grps_upd set [count _grps_upd,_group]; - // update AI monitor - _check = [["grps_band"],[_grps_upd],_markername] call SAR_AI_mon_upd; - }; - }; - }; - - _grps_upd = _grps_sold; - - //for [{_i = (count _grps_sold)},{_i < (_max_grps select 1)}, {_i=_i+1}] do - for "_i" from (count _grps_sold) to ((_max_grps select 1) - 1) do - { - if(_max_p_grp select 1 > 0) then { - _probability = _rnd_grps select 1; - _chance = (random 100); - if(_chance < _probability) then { - _snipers=floor (random ((_max_p_grp select 1)-1)); - _soldiers =((_max_p_grp select 1)-1) - _snipers; - _group = [_markername,1,_snipers,_soldiers,"",_respawn] call SAR_AI; - _grps_upd set [count _grps_upd,_group]; - // update AI monitor - _check = [["grps_sold"],[_grps_upd],_markername] call SAR_AI_mon_upd; - }; - }; - }; - - _grps_upd = _grps_surv; - - //for [{_i = (count _grps_surv)},{_i < (_max_grps select 2)}, {_i=_i+1}] do - for "_i" from (count _grps_surv) to ((_max_grps select 2) - 1) do - { - if(_max_p_grp select 2 > 0) then { - _probability = _rnd_grps select 2; - _chance = (random 100); - if(_chance < _probability) then { - _snipers=floor (random ((_max_p_grp select 2)-1)); - _soldiers =((_max_p_grp select 2)-1) - _snipers; - _group = [_markername,2,_snipers,_soldiers,"",_respawn] call SAR_AI; - _grps_upd set [count _grps_upd,_group]; - // update AI monitor - _check = [["grps_surv"],[_grps_upd],_markername] call SAR_AI_mon_upd; - }; - }; - }; - }; +//for [{_i = (count _grps_surv)},{_i < (_max_grps select 2)}, {_i=_i+1}] do +for "_i" from (count _grps_surv) to ((_max_grps select 2) - 1) do +{ + if(_max_p_grp select 2 > 0) then { + _probability = _rnd_grps select 2; + _chance = (random 100); + if(_chance < _probability) then { + _snipers=floor (random ((_max_p_grp select 2)-1)); + _soldiers =((_max_p_grp select 2)-1) - _snipers; + _group = [_markername,2,_snipers,_soldiers,"",_respawn] call SAR_AI; + _grps_upd set [count _grps_upd,_group]; + // update AI monitor + _check = [["grps_surv"],[_grps_upd],_markername] call SAR_AI_mon_upd; + }; + }; }; // DEBUG