#2027 fixed - allow custom starting units for each faction
This commit is contained in:
@@ -16,6 +16,7 @@ namespace OpenRA.Mods.RA
|
|||||||
class SpawnMPUnitsInfo : ITraitInfo, Requires<MPStartLocationsInfo>
|
class SpawnMPUnitsInfo : ITraitInfo, Requires<MPStartLocationsInfo>
|
||||||
{
|
{
|
||||||
public readonly string InitialUnit = "mcv";
|
public readonly string InitialUnit = "mcv";
|
||||||
|
public readonly string Faction = null;
|
||||||
|
|
||||||
public object Create (ActorInitializer init) { return new SpawnMPUnits(this); }
|
public object Create (ActorInitializer init) { return new SpawnMPUnits(this); }
|
||||||
}
|
}
|
||||||
@@ -37,6 +38,10 @@ namespace OpenRA.Mods.RA
|
|||||||
if (!p.PlayerReference.DefaultStartingUnits)
|
if (!p.PlayerReference.DefaultStartingUnits)
|
||||||
return; /* they don't want an mcv, the map provides something else for them */
|
return; /* they don't want an mcv, the map provides something else for them */
|
||||||
|
|
||||||
|
/* support different starting units for each faction */
|
||||||
|
if (info.Faction != null && p.Country.Race != info.Faction)
|
||||||
|
return;
|
||||||
|
|
||||||
p.World.CreateActor(info.InitialUnit, new TypeDictionary
|
p.World.CreateActor(info.InitialUnit, new TypeDictionary
|
||||||
{
|
{
|
||||||
new LocationInit( sp ),
|
new LocationInit( sp ),
|
||||||
|
|||||||
Reference in New Issue
Block a user