Fix a pile of compiler warnings.

This commit is contained in:
Paul Chote
2010-11-21 12:53:04 +13:00
parent 1461309dba
commit dba7335594
8 changed files with 7 additions and 20 deletions

View File

@@ -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);

View File

@@ -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<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r)

View File

@@ -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<string, string> 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<MapPreviewWidget>("LOBBY_MAP_PREVIEW");
mapPreview.Map = () => Map;

View File

@@ -54,10 +54,6 @@ namespace OpenRA.Mods.RA.Activities
return (AllowMovement) ? Util.SequenceActivities(self.Trait<Mobile>().MoveWithinRange(Target, Range), this) : NextActivity;
var desiredFacing = Util.GetFacing(Target.CenterLocation - self.CenterLocation, 0);
var renderUnit = self.TraitOrDefault<RenderUnit>();
var numDirs = (renderUnit != null)
? renderUnit.anim.CurrentSequence.Facings : 8;
if (facing.Facing != desiredFacing)
return Util.SequenceActivities( new Turn( desiredFacing ), this );

View File

@@ -57,8 +57,6 @@ namespace OpenRA.Mods.RA
return NextActivity;
var attack = self.Trait<AttackBase>();
var range = attack.GetMaximumRange();
currentTarget = attack.ScanForTarget(self, null);
if( currentTarget != null )
inner = attack.GetAttackActivity( self, Target.FromActor(currentTarget), self.Info.Traits.Get<AutoTargetInfo>().AllowMovement );

View File

@@ -103,8 +103,6 @@ namespace OpenRA.Mods.RA.Buildings
this.topLeft = init.Get<LocationInit,int2>();
this.Info = self.Info.Traits.Get<BuildingInfo>();
this.PlayerPower = init.self.Owner.PlayerActor.Trait<PowerManager>();
var uim = init.world.WorldActor.Trait<UnitInfluence>();
}
public int GetPowerUsage()

View File

@@ -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<LocationInit,int2>();
this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit,int>() : 128;
}

View File

@@ -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)
{