From dba73355946ca669cc4bc790a0c14de34389f5cb Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 21 Nov 2010 12:53:04 +1300 Subject: [PATCH] Fix a pile of compiler warnings. --- OpenRA.FileFormats/Filesystem/InstallShieldPackage.cs | 6 +++--- OpenRA.Game/Traits/Scale.cs | 6 ++---- OpenRA.Game/Widgets/Delegates/LobbyDelegate.cs | 3 +-- OpenRA.Mods.RA/Activities/Attack.cs | 4 ---- OpenRA.Mods.RA/AutoTarget.cs | 2 -- OpenRA.Mods.RA/Buildings/Building.cs | 2 -- OpenRA.Mods.RA/Husk.cs | 2 -- OpenRA.Mods.RA/ProximityCapturable.cs | 2 +- 8 files changed, 7 insertions(+), 20 deletions(-) diff --git a/OpenRA.FileFormats/Filesystem/InstallShieldPackage.cs b/OpenRA.FileFormats/Filesystem/InstallShieldPackage.cs index 92c3708ce5..b260c9386d 100644 --- a/OpenRA.FileFormats/Filesystem/InstallShieldPackage.cs +++ b/OpenRA.FileFormats/Filesystem/InstallShieldPackage.cs @@ -34,9 +34,9 @@ namespace OpenRA.FileFormats throw new InvalidDataException("Not an Installshield package"); reader.ReadBytes(8); - var FileCount = reader.ReadUInt16(); + /*var FileCount = */reader.ReadUInt16(); reader.ReadBytes(4); - var ArchiveSize = reader.ReadUInt32(); + /*var ArchiveSize = */reader.ReadUInt32(); reader.ReadBytes(19); var TOCAddress = reader.ReadInt32(); reader.ReadBytes(4); @@ -55,7 +55,7 @@ namespace OpenRA.FileFormats var FileCount = reader.ReadUInt16(); var ChunkSize = reader.ReadUInt16(); var NameLength = reader.ReadUInt16(); - var DirName = new String(reader.ReadChars(NameLength)); + reader.ReadChars(NameLength); //var DirName = new String(reader.ReadChars(NameLength)); // Skip to the end of the chunk reader.ReadBytes(ChunkSize - NameLength - 6); diff --git a/OpenRA.Game/Traits/Scale.cs b/OpenRA.Game/Traits/Scale.cs index b6d22a0fb4..94c25bd4b8 100644 --- a/OpenRA.Game/Traits/Scale.cs +++ b/OpenRA.Game/Traits/Scale.cs @@ -8,18 +8,16 @@ namespace OpenRA.Traits public ScaleInfo() { } /* only because we have other ctors */ - public object Create(ActorInitializer init) { return new Scale(init.self, this); } + public object Create(ActorInitializer init) { return new Scale(this); } } public class Scale : IRenderModifier { - Actor self; public ScaleInfo Info { get; protected set; } - public Scale(Actor self, ScaleInfo info) + public Scale(ScaleInfo info) { this.Info = info; - this.self = self; } public IEnumerable ModifyRender(Actor self, IEnumerable r) diff --git a/OpenRA.Game/Widgets/Delegates/LobbyDelegate.cs b/OpenRA.Game/Widgets/Delegates/LobbyDelegate.cs index c90300cb08..ac99cd4f6b 100755 --- a/OpenRA.Game/Widgets/Delegates/LobbyDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/LobbyDelegate.cs @@ -19,7 +19,7 @@ namespace OpenRA.Widgets.Delegates { public class LobbyDelegate : IWidgetDelegate { - Widget Players, LocalPlayerTemplate, RemotePlayerTemplate, EmptySlotTemplate, EmptySlotTemplateHost, EmptySpectatorSlotTemplateHost; + Widget Players, LocalPlayerTemplate, RemotePlayerTemplate, EmptySlotTemplate, EmptySlotTemplateHost; Dictionary CountryNames; string MapUid; @@ -44,7 +44,6 @@ namespace OpenRA.Widgets.Delegates RemotePlayerTemplate = Players.GetWidget("TEMPLATE_REMOTE"); EmptySlotTemplate = Players.GetWidget("TEMPLATE_EMPTY"); EmptySlotTemplateHost = Players.GetWidget("TEMPLATE_EMPTY_HOST"); - EmptySpectatorSlotTemplateHost = Players.GetWidget("TEMPLATE_EMPTY_SPECTATOR"); var mapPreview = lobby.GetWidget("LOBBY_MAP_PREVIEW"); mapPreview.Map = () => Map; diff --git a/OpenRA.Mods.RA/Activities/Attack.cs b/OpenRA.Mods.RA/Activities/Attack.cs index 25678ac18f..260398684c 100755 --- a/OpenRA.Mods.RA/Activities/Attack.cs +++ b/OpenRA.Mods.RA/Activities/Attack.cs @@ -54,10 +54,6 @@ namespace OpenRA.Mods.RA.Activities return (AllowMovement) ? Util.SequenceActivities(self.Trait().MoveWithinRange(Target, Range), this) : NextActivity; var desiredFacing = Util.GetFacing(Target.CenterLocation - self.CenterLocation, 0); - var renderUnit = self.TraitOrDefault(); - var numDirs = (renderUnit != null) - ? renderUnit.anim.CurrentSequence.Facings : 8; - if (facing.Facing != desiredFacing) return Util.SequenceActivities( new Turn( desiredFacing ), this ); diff --git a/OpenRA.Mods.RA/AutoTarget.cs b/OpenRA.Mods.RA/AutoTarget.cs index 86a59a71b5..a2eb29746e 100644 --- a/OpenRA.Mods.RA/AutoTarget.cs +++ b/OpenRA.Mods.RA/AutoTarget.cs @@ -57,8 +57,6 @@ namespace OpenRA.Mods.RA return NextActivity; var attack = self.Trait(); - var range = attack.GetMaximumRange(); - currentTarget = attack.ScanForTarget(self, null); if( currentTarget != null ) inner = attack.GetAttackActivity( self, Target.FromActor(currentTarget), self.Info.Traits.Get().AllowMovement ); diff --git a/OpenRA.Mods.RA/Buildings/Building.cs b/OpenRA.Mods.RA/Buildings/Building.cs index 5d94465b66..7b8a77e281 100755 --- a/OpenRA.Mods.RA/Buildings/Building.cs +++ b/OpenRA.Mods.RA/Buildings/Building.cs @@ -103,8 +103,6 @@ namespace OpenRA.Mods.RA.Buildings this.topLeft = init.Get(); this.Info = self.Info.Traits.Get(); this.PlayerPower = init.self.Owner.PlayerActor.Trait(); - - var uim = init.world.WorldActor.Trait(); } public int GetPowerUsage() diff --git a/OpenRA.Mods.RA/Husk.cs b/OpenRA.Mods.RA/Husk.cs index 57e952506d..c7cfba4e12 100644 --- a/OpenRA.Mods.RA/Husk.cs +++ b/OpenRA.Mods.RA/Husk.cs @@ -20,7 +20,6 @@ namespace OpenRA.Mods.RA class Husk : IOccupySpace, IFacing { - Actor self; [Sync] int2 location; @@ -31,7 +30,6 @@ namespace OpenRA.Mods.RA public Husk(ActorInitializer init) { - this.self = init.self; this.location = init.Get(); this.Facing = init.Contains() ? init.Get() : 128; } diff --git a/OpenRA.Mods.RA/ProximityCapturable.cs b/OpenRA.Mods.RA/ProximityCapturable.cs index 0513d4faef..44a47de647 100644 --- a/OpenRA.Mods.RA/ProximityCapturable.cs +++ b/OpenRA.Mods.RA/ProximityCapturable.cs @@ -54,7 +54,7 @@ namespace OpenRA.Mods.RA { if (Captured && Permanent) return; // Permanent capture - var playersNear = CountPlayersNear(self, OriginalOwner, Range); + //var playersNear = CountPlayersNear(self, OriginalOwner, Range); if (!Captured) {