reinstate CrateAction.ExcludedActorTypes; custom maps use this.
This commit is contained in:
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.RA
|
|||||||
public void OnCrush(Actor crusher)
|
public void OnCrush(Actor crusher)
|
||||||
{
|
{
|
||||||
var shares = self.TraitsImplementing<CrateAction>().Select(
|
var shares = self.TraitsImplementing<CrateAction>().Select(
|
||||||
a => Pair.New(a, a.GetSelectionShares(crusher)));
|
a => Pair.New(a, a.GetSelectionSharesOuter(crusher)));
|
||||||
var totalShares = shares.Sum(a => a.Second);
|
var totalShares = shares.Sum(a => a.Second);
|
||||||
var n = self.World.SharedRandom.Next(totalShares);
|
var n = self.World.SharedRandom.Next(totalShares);
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ namespace OpenRA.Mods.RA
|
|||||||
public int SelectionShares = 10;
|
public int SelectionShares = 10;
|
||||||
public string Effect = null;
|
public string Effect = null;
|
||||||
public string Notification = null;
|
public string Notification = null;
|
||||||
|
public string[] ExcludedActorTypes = { };
|
||||||
|
|
||||||
public virtual object Create(ActorInitializer init) { return new CrateAction(init.self, this); }
|
public virtual object Create(ActorInitializer init) { return new CrateAction(init.self, this); }
|
||||||
}
|
}
|
||||||
@@ -34,6 +35,14 @@ namespace OpenRA.Mods.RA
|
|||||||
this.info = info;
|
this.info = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int GetSelectionSharesOuter(Actor collector)
|
||||||
|
{
|
||||||
|
if (info.ExcludedActorTypes.Contains(collector.Info.Name))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return GetSelectionShares(collector);
|
||||||
|
}
|
||||||
|
|
||||||
public virtual int GetSelectionShares(Actor collector)
|
public virtual int GetSelectionShares(Actor collector)
|
||||||
{
|
{
|
||||||
return info.SelectionShares;
|
return info.SelectionShares;
|
||||||
|
|||||||
Reference in New Issue
Block a user