Separated ship squad from ground unit squad

Just like aircrafts are independent from ground squads.
This commit is contained in:
Forcecore
2017-07-07 20:32:40 -05:00
committed by reaperrr
parent 5ddf28fa81
commit 8027bed6b2
5 changed files with 219 additions and 1 deletions

View File

@@ -43,6 +43,7 @@ namespace OpenRA.Mods.Common.AI
public class UnitCategories
{
public readonly HashSet<string> Mcv = new HashSet<string>();
public readonly HashSet<string> NavalUnits = new HashSet<string>();
public readonly HashSet<string> ExcludeFromSquads = new HashSet<string>();
}
@@ -837,6 +838,14 @@ namespace OpenRA.Mods.Common.AI
air.Units.Add(a);
}
else if (Info.UnitsCommonNames.NavalUnits.Contains(a.Info.Name))
{
var ships = GetSquadOfType(SquadType.Naval);
if (ships == null)
ships = RegisterNewSquad(SquadType.Naval);
ships.Units.Add(a);
}
activeUnits.Add(a);
}