diff --git a/OpenRA.Game/Network/ReplayConnection.cs b/OpenRA.Game/Network/ReplayConnection.cs index b8a73b6710..277e834882 100755 --- a/OpenRA.Game/Network/ReplayConnection.cs +++ b/OpenRA.Game/Network/ReplayConnection.cs @@ -52,13 +52,11 @@ namespace OpenRA.Network class ReplayRecorderConnection : IConnection { IConnection inner; - FileStream replayFile; BinaryWriter writer; public ReplayRecorderConnection( IConnection inner, FileStream replayFile ) { this.inner = inner; - this.replayFile = replayFile; this.writer = new BinaryWriter( replayFile ); } diff --git a/OpenRA.Game/Network/UnitOrders.cs b/OpenRA.Game/Network/UnitOrders.cs index 816a479b6f..79a614fcf1 100755 --- a/OpenRA.Game/Network/UnitOrders.cs +++ b/OpenRA.Game/Network/UnitOrders.cs @@ -43,7 +43,7 @@ namespace OpenRA.Network { var player = world != null ? world.FindPlayerByClient(client) : null; var suffix = (player != null && player.WinState == WinState.Lost) ? " (Dead)" : ""; - Game.AddChatLine(client.Color1, client.Name, order.TargetString); + Game.AddChatLine(client.Color1, client.Name+suffix, order.TargetString); } else Game.AddChatLine(Color.White, "(player {0})".F(clientId), order.TargetString); @@ -105,7 +105,6 @@ namespace OpenRA.Network case "SetStance": { var targetPlayer = order.Player.World.players[order.TargetLocation.X]; - var oldStance = order.Player.Stances[targetPlayer]; var newStance = (Stance)order.TargetLocation.Y; SetPlayerStance(world, order.Player, targetPlayer, newStance); diff --git a/OpenRA.Game/Widgets/Delegates/DeveloperModeDelegate.cs b/OpenRA.Game/Widgets/Delegates/DeveloperModeDelegate.cs index b1c4ab5949..b9fc9c37ec 100644 --- a/OpenRA.Game/Widgets/Delegates/DeveloperModeDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/DeveloperModeDelegate.cs @@ -27,11 +27,9 @@ namespace OpenRA.Widgets.Delegates { public class DeveloperModeDelegate : IWidgetDelegate { - readonly World world; [ObjectCreator.UseCtor] public DeveloperModeDelegate( [ObjectCreator.Param] World world ) { - this.world = world; var devmodeBG = Widget.RootWidget.GetWidget("INGAME_ROOT").GetWidget("DEVELOPERMODE_BG"); var devModeButton = Widget.RootWidget.GetWidget("INGAME_DEVELOPERMODE_BUTTON"); diff --git a/OpenRA.Mods.RA/BridgeLayer.cs b/OpenRA.Mods.RA/BridgeLayer.cs index 7dea62f778..841678cba8 100644 --- a/OpenRA.Mods.RA/BridgeLayer.cs +++ b/OpenRA.Mods.RA/BridgeLayer.cs @@ -45,10 +45,7 @@ namespace OpenRA.Mods.RA { var bi = Rules.Info[bridge].Traits.Get(); foreach (var template in bi.Templates) - { BridgeTypes.Add(template.First, Pair.New(bridge, template.Second)); - Log.Write("debug", "Adding template {0} for bridge {1}", template, bridge); - } } // Loop through the map looking for templates to overlay @@ -66,9 +63,7 @@ namespace OpenRA.Mods.RA } void ConvertBridgeToActor(World w, int i, int j) - { - Log.Write("debug", "Converting bridge at {0} {1}", i, j); - + { // This cell already has a bridge overlaying it from a previous iteration if (Bridges[i,j] != null) return; @@ -104,9 +99,7 @@ namespace OpenRA.Mods.RA // This isn't the bridge you're looking for if (!w.Map.IsInMap(x, y) || w.Map.MapTiles[x, y].image != ind) continue; - - Log.Write("debug", "Adding tile {0} {1} for type {2}", x,y,tile); - + subTiles.Add(new int2(x,y),ind); Bridges[x,y] = bridge; } diff --git a/OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs b/OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs index 346dcc3295..f17b10428b 100755 --- a/OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs +++ b/OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs @@ -34,11 +34,9 @@ namespace OpenRA.Mods.RA.Orders world.CancelInputMode(); var ret = InnerOrder( world, xy, mi ).ToList(); - foreach( var order in ret ) - { + if (ret.Count > 0) world.CancelInputMode(); - break; - } + return ret; } diff --git a/OpenRA.Mods.RA/Player/ProductionQueue.cs b/OpenRA.Mods.RA/Player/ProductionQueue.cs index 5e8e3c770b..3d67be8e9e 100755 --- a/OpenRA.Mods.RA/Player/ProductionQueue.cs +++ b/OpenRA.Mods.RA/Player/ProductionQueue.cs @@ -276,7 +276,7 @@ namespace OpenRA.Mods.RA OnComplete = onComplete; Queue = queue; - Log.Write("debug", "new ProductionItem: {0} time={1} cost={2}", item, time, cost); + //Log.Write("debug", "new ProductionItem: {0} time={1} cost={2}", item, time, cost); } public void Tick(PlayerResources pr, PowerManager pm) diff --git a/OpenRA.Mods.RA/Production.cs b/OpenRA.Mods.RA/Production.cs index f9c51defbb..529bb28068 100755 --- a/OpenRA.Mods.RA/Production.cs +++ b/OpenRA.Mods.RA/Production.cs @@ -89,7 +89,7 @@ namespace OpenRA.Mods.RA foreach (var t in self.TraitsImplementing()) t.UnitProduced(self, newUnit, exit); - Log.Write("debug", "{0} #{1} produced by {2} #{3}", newUnit.Info.Name, newUnit.ActorID, self.Info.Name, self.ActorID); + //Log.Write("debug", "{0} #{1} produced by {2} #{3}", newUnit.Info.Name, newUnit.ActorID, self.Info.Name, self.ActorID); } public virtual bool Produce( Actor self, ActorInfo producee ) diff --git a/OpenRA.Mods.RA/ReservableProduction.cs b/OpenRA.Mods.RA/ReservableProduction.cs index 0b72741bd8..a6635ec6f8 100644 --- a/OpenRA.Mods.RA/ReservableProduction.cs +++ b/OpenRA.Mods.RA/ReservableProduction.cs @@ -35,7 +35,6 @@ namespace OpenRA.Mods.RA foreach (var s in self.Info.Traits.WithInterface()) { var exit = self.Location + s.ExitCell; - var spawn = self.CenterLocation + s.SpawnOffset; if (!self.World.WorldActor.Trait().GetUnitsAt( exit ).Any()) { var newUnit = self.World.CreateActor( producee.Name, new TypeDictionary @@ -53,7 +52,7 @@ namespace OpenRA.Mods.RA foreach (var t in self.TraitsImplementing()) t.UnitProduced(self, newUnit, exit); - Log.Write("debug", "{0} #{1} produced by {2} #{3}", newUnit.Info.Name, newUnit.ActorID, self.Info.Name, self.ActorID); + //Log.Write("debug", "{0} #{1} produced by {2} #{3}", newUnit.Info.Name, newUnit.ActorID, self.Info.Name, self.ActorID); return true; } } diff --git a/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs b/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs index 82f65157cf..b39d586b8c 100755 --- a/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs @@ -119,11 +119,8 @@ namespace OpenRA.Mods.RA world.CancelInputMode(); var ret = OrderInner( world, xy, mi ).ToList(); - foreach( var order in ret ) - { + if (ret.Count > 0) world.CancelInputMode(); - break; - } return ret; } diff --git a/OpenRA.Mods.RA/Widgets/Delegates/IngameChromeDelegate.cs b/OpenRA.Mods.RA/Widgets/Delegates/IngameChromeDelegate.cs index 7d44680dd1..5ce8f1a2c2 100755 --- a/OpenRA.Mods.RA/Widgets/Delegates/IngameChromeDelegate.cs +++ b/OpenRA.Mods.RA/Widgets/Delegates/IngameChromeDelegate.cs @@ -15,11 +15,9 @@ namespace OpenRA.Mods.RA.Widgets.Delegates { public class IngameChromeDelegate : IWidgetDelegate { - readonly World world; [ObjectCreator.UseCtor] public IngameChromeDelegate( [ObjectCreator.Param] World world ) { - this.world = world; var r = Widget.RootWidget; var gameRoot = r.GetWidget("INGAME_ROOT"); var optionsBG = gameRoot.GetWidget("INGAME_OPTIONS_BG"); diff --git a/OpenRA.Mods.RA/Widgets/Delegates/OrderButtonsChromeDelegate.cs b/OpenRA.Mods.RA/Widgets/Delegates/OrderButtonsChromeDelegate.cs index e51cf61a2f..2b83c3acd4 100644 --- a/OpenRA.Mods.RA/Widgets/Delegates/OrderButtonsChromeDelegate.cs +++ b/OpenRA.Mods.RA/Widgets/Delegates/OrderButtonsChromeDelegate.cs @@ -16,11 +16,9 @@ namespace OpenRA.Mods.RA.Widgets.Delegates { public class OrderButtonsChromeDelegate : IWidgetDelegate { - readonly World world; [ObjectCreator.UseCtor] public OrderButtonsChromeDelegate( [ObjectCreator.Param] World world ) { - this.world = world; var r = Widget.RootWidget; var gameRoot = r.GetWidget("INGAME_ROOT");