Remove unused parameters and variables.

This commit is contained in:
Matthias Mailänder
2021-12-05 13:27:29 +01:00
committed by abcdefg30
parent 07815143f1
commit 9d905d8291
31 changed files with 54 additions and 59 deletions

View File

@@ -243,11 +243,11 @@ namespace OpenRA.Mods.Common.Traits
return false;
}
return !IsEmpty(self) && (aircraft == null || aircraft.CanLand(self.Location, blockedByMobile: false))
return !IsEmpty() && (aircraft == null || aircraft.CanLand(self.Location, blockedByMobile: false))
&& CurrentAdjacentCells != null && CurrentAdjacentCells.Any(c => Passengers.Any(p => !p.IsDead && p.Trait<IPositionable>().CanEnterCell(c, null, check)));
}
public bool CanLoad(Actor self, Actor a)
public bool CanLoad(Actor a)
{
return reserves.Contains(a) || HasSpace(GetWeight(a));
}
@@ -320,16 +320,16 @@ namespace OpenRA.Mods.Common.Traits
public string VoicePhraseForOrder(Actor self, Order order)
{
if (order.OrderString != "Unload" || IsEmpty(self) || !self.HasVoice(Info.UnloadVoice))
if (order.OrderString != "Unload" || IsEmpty() || !self.HasVoice(Info.UnloadVoice))
return null;
return Info.UnloadVoice;
}
public bool HasSpace(int weight) { return totalWeight + reservedWeight + weight <= Info.MaxWeight; }
public bool IsEmpty(Actor self) { return cargo.Count == 0; }
public bool IsEmpty() { return cargo.Count == 0; }
public Actor Peek(Actor self) { return cargo.Last(); }
public Actor Peek() { return cargo.Last(); }
public Actor Unload(Actor self, Actor passenger = null)
{
@@ -406,7 +406,7 @@ namespace OpenRA.Mods.Common.Traits
void INotifyKilled.Killed(Actor self, AttackInfo e)
{
if (Info.EjectOnDeath)
while (!IsEmpty(self) && CanUnload(BlockedByActor.All))
while (!IsEmpty() && CanUnload(BlockedByActor.All))
{
var passenger = Unload(self);
var cp = self.CenterPosition;
@@ -445,7 +445,7 @@ namespace OpenRA.Mods.Common.Traits
if (!Info.EjectOnSell || cargo == null)
return;
while (!IsEmpty(self))
while (!IsEmpty())
SpawnPassenger(Unload(self));
}