Add support for arbitrary objective type names

This commit is contained in:
abcdefg30
2019-03-07 19:46:06 +01:00
committed by reaperrr
parent 38b3a4a668
commit b2278e85f0
5 changed files with 33 additions and 35 deletions

View File

@@ -46,10 +46,11 @@ namespace OpenRA.Mods.Common.Traits
void ITick.Tick(Actor self)
{
if (self.Owner.WinState != WinState.Undefined || self.Owner.NonCombatant) return;
if (self.Owner.WinState != WinState.Undefined || self.Owner.NonCombatant)
return;
if (objectiveID < 0)
objectiveID = mo.Add(self.Owner, info.Objective, ObjectiveType.Primary, true);
objectiveID = mo.Add(self.Owner, info.Objective, "Primary", inhibitAnnouncement: true);
if (!self.Owner.NonCombatant && self.Owner.HasNoRequiredUnits(shortGame))
mo.MarkFailed(self.Owner, objectiveID);