Remove RearmBuildings from Aircraft and Minelayer

In favor of using Rearmable trait.
This commit is contained in:
reaperrr
2018-09-27 17:50:35 +02:00
committed by Paul Chote
parent 2485029452
commit 8f1d8a67cc
19 changed files with 191 additions and 69 deletions

View File

@@ -127,7 +127,11 @@ namespace OpenRA.Mods.Common.AI
protected static bool ReloadsAutomatically(Actor a)
{
var ammoPools = a.TraitsImplementing<AmmoPool>();
return ammoPools.All(x => x.AutoReloads);
var rearmable = a.TraitOrDefault<Rearmable>();
if (rearmable == null)
return true;
return ammoPools.All(ap => !rearmable.Info.AmmoPools.Contains(ap.Info.Name));
}
protected static bool IsRearm(Actor a)