diff --git a/OpenRA.Game/Actor.cs b/OpenRA.Game/Actor.cs index 47bfa08aca..2152b70a8c 100755 --- a/OpenRA.Game/Actor.cs +++ b/OpenRA.Game/Actor.cs @@ -128,9 +128,9 @@ namespace OpenRA Bounds.Invalidate(); ExtendedBounds.Invalidate(); - currentActivity = Traits.Util.RunActivity( this, currentActivity ); + currentActivity = Traits.Util.RunActivity(this, currentActivity); } - + public void UpdateSight() { Sight.vis = Shroud.GetVisOrigins(this).ToArray(); diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 87fdcf7cdb..44f308735e 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -122,17 +122,17 @@ namespace OpenRA public static void RunAfterTick(Action a) { delayedActions.Add(a); } public static void RunAfterDelay(int delay, Action a) { delayedActions.Add(a, delay); } - static void Tick( OrderManager orderManager, Viewport viewPort ) + static void Tick(OrderManager orderManager, Viewport viewPort) { if (orderManager.Connection.ConnectionState != lastConnectionState) { lastConnectionState = orderManager.Connection.ConnectionState; - ConnectionStateChanged( orderManager ); + ConnectionStateChanged(orderManager); } - Tick( orderManager ); - if( worldRenderer != null && orderManager.world != worldRenderer.world ) - Tick( worldRenderer.world.orderManager ); + Tick(orderManager); + if (worldRenderer != null && orderManager.world != worldRenderer.world) + Tick(worldRenderer.world.orderManager); using (new PerfSample("render")) { diff --git a/OpenRA.Game/Traits/Health.cs b/OpenRA.Game/Traits/Health.cs index f62c979b71..fc91a75023 100755 --- a/OpenRA.Game/Traits/Health.cs +++ b/OpenRA.Game/Traits/Health.cs @@ -144,7 +144,7 @@ namespace OpenRA.Traits .Concat(self.Owner.PlayerActor.TraitsImplementing())) nd.Killed(self, ai); - if( RemoveOnDeath ) + if (RemoveOnDeath) self.Destroy(); Log.Write("debug", "{0} #{1} killed by {2} #{3}", self.Info.Name, self.ActorID, attacker.Info.Name, attacker.ActorID); diff --git a/OpenRA.Game/Traits/Util.cs b/OpenRA.Game/Traits/Util.cs index 9702da05ff..6b605ab4d1 100755 --- a/OpenRA.Game/Traits/Util.cs +++ b/OpenRA.Game/Traits/Util.cs @@ -110,19 +110,19 @@ namespace OpenRA.Traits (next, a) => { a.Queue( next ); return a; }); } - public static Activity RunActivity( Actor self, Activity act ) + public static Activity RunActivity(Actor self, Activity act) { - while( act != null ) + while (act != null) { var prev = act; var sw = new Stopwatch(); - act = act.Tick( self ); + act = act.Tick(self); var dt = sw.ElapsedTime(); - if(dt > Game.Settings.Debug.LongTickThreshold) + if (dt > Game.Settings.Debug.LongTickThreshold) Log.Write("perf", "[{2}] Activity: {0} ({1:0.000} ms)", prev, dt * 1000, Game.LocalTick); - if( prev == act ) + if (prev == act) break; } return act; diff --git a/OpenRA.Mods.RA/Air/Aircraft.cs b/OpenRA.Mods.RA/Air/Aircraft.cs index 16d48d66f3..55958cb82f 100755 --- a/OpenRA.Mods.RA/Air/Aircraft.cs +++ b/OpenRA.Mods.RA/Air/Aircraft.cs @@ -86,10 +86,8 @@ namespace OpenRA.Mods.RA.Air protected void ReserveSpawnBuilding() { - /* not spawning in the air, so try to assoc. with our afld. this is a hack. */ - + /* HACK: not spawning in the air, so try to assoc. with our afld. */ var afld = GetActorBelow(); - if (afld == null) return; @@ -102,10 +100,10 @@ namespace OpenRA.Mods.RA.Air public void SetPosition(Actor self, CPos cell) { - SetPxPosition( self, Util.CenterOfCell( cell ) ); + SetPxPosition(self, Util.CenterOfCell(cell)); } - public void SetPxPosition( Actor self, PPos px ) + public void SetPxPosition(Actor self, PPos px) { SubPxPosition = px.ToPSubPos(); } @@ -114,9 +112,9 @@ namespace OpenRA.Mods.RA.Air public bool AircraftCanEnter(Actor a) { - if( self.AppearsHostileTo(a) ) return false; - return Info.RearmBuildings.Contains( a.Info.Name ) - || Info.RepairBuildings.Contains( a.Info.Name ); + if (self.AppearsHostileTo(a)) return false; + return Info.RearmBuildings.Contains(a.Info.Name) + || Info.RepairBuildings.Contains(a.Info.Name); } public bool CanEnterCell(CPos location) { return true; } @@ -126,7 +124,7 @@ namespace OpenRA.Mods.RA.Air get { decimal ret = Info.Speed; - foreach( var t in self.TraitsImplementing() ) + foreach (var t in self.TraitsImplementing()) ret *= t.GetSpeedModifier(); return (int)ret; } @@ -135,7 +133,7 @@ namespace OpenRA.Mods.RA.Air Pair[] noCells = new Pair[] { }; public IEnumerable> OccupiedCells() { return noCells; } - public void TickMove( int speed, int facing ) + public void TickMove(int speed, int facing) { var rawspeed = speed * 7 / (32 * PSubPos.PerPx); SubPxPosition += rawspeed * -Util.SubPxVector[facing]; @@ -186,7 +184,7 @@ namespace OpenRA.Mods.RA.Air public string VoicePhraseForOrder(Actor self, Order order) { - switch( order.OrderString ) + switch (order.OrderString) { case "Move": case "Enter": diff --git a/OpenRA.Mods.RA/Air/Helicopter.cs b/OpenRA.Mods.RA/Air/Helicopter.cs index d65b3c06c6..d0f18f4bea 100755 --- a/OpenRA.Mods.RA/Air/Helicopter.cs +++ b/OpenRA.Mods.RA/Air/Helicopter.cs @@ -106,7 +106,8 @@ namespace OpenRA.Mods.RA.Air if (firstTick) { firstTick = false; - ReserveSpawnBuilding(); + if (!self.HasTrait()) // TODO: Aircraft husks don't properly unreserve. + ReserveSpawnBuilding(); } /* repulsion only applies when we're flying */ diff --git a/OpenRA.Mods.RA/Air/Plane.cs b/OpenRA.Mods.RA/Air/Plane.cs index 615e5bcbc8..6a877be1ed 100755 --- a/OpenRA.Mods.RA/Air/Plane.cs +++ b/OpenRA.Mods.RA/Air/Plane.cs @@ -32,7 +32,8 @@ namespace OpenRA.Mods.RA.Air if (firstTick) { firstTick = false; - ReserveSpawnBuilding(); + if (!self.HasTrait()) // TODO: Aircraft husks don't properly unreserve. + ReserveSpawnBuilding(); } }