Skip to content

Commit f81b15d

Browse files
committed
fix for nato objective not finding a pos at spawn
1 parent 086c3b5 commit f81b15d

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

addons/overthrow_main.pbo

176 Bytes
Binary file not shown.

addons/overthrow_main/functions/AI/NPC/fn_initMilitary.sqf

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ _type = typeof _unit;
44

55
//Make silencers rare
66
_items = primaryWeaponItems _unit;
7-
if !(_items#0 isEqualTo "") then {
8-
if((random 100) < 99) then {
9-
_unit removePrimaryWeaponItem (_items#0);
10-
}
7+
if(!isNil "_items") then {
8+
if !(_items#0 isEqualTo "") then {
9+
if((random 100) < 99) then {
10+
_unit removePrimaryWeaponItem (_items#0);
11+
}
12+
};
1113
};
1214

1315
//Re-Equip this soldier (75% of the time)
@@ -39,9 +41,11 @@ if((random 100) > 25) then {
3941

4042

4143
//put accessories back (where possible)
42-
{
43-
_unit addWeaponItem [_wpn, _x];
44-
}foreach(_accessories);
44+
if(!isNil "_accessories") then {
45+
{
46+
_unit addWeaponItem [_wpn, _x];
47+
}foreach(_accessories);
48+
};
4549

4650
_magazines = getArray (configFile / "CfgWeapons" / _wpn / "magazines");
4751

addons/overthrow_main/functions/virtualization/spawners/fn_spawnNATOObjective.sqf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ if(_name in OT_allComms) then {
6464

6565
if(_count < _numNATO) then {
6666
_start = _posTown findEmptyPosition [2,50];
67+
if((count _start) isEqualTo 0) then {
68+
_start = _posTown findEmptyPosition [2,150];
69+
};
6770
_civ = _group createUnit [OT_NATO_Unit_AA_ass, _start, [], 0, "NONE"];
6871
_civ setVariable ["garrison",_name,false];
6972
_civ setRank "CAPTAIN";

0 commit comments

Comments
 (0)