Remove unnecessary parentheses
This commit is contained in:
@@ -215,10 +215,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
var offset = buildingInfo.CenterOffset(self.World).Y + 1024;
|
||||
|
||||
return footprint.Select(c => (IRenderable)(new SpriteRenderable(
|
||||
return footprint.Select(c => (IRenderable)new SpriteRenderable(
|
||||
terrainRenderer.TileSprite(new TerrainTile(template, c.Value)),
|
||||
wr.World.Map.CenterOfCell(c.Key), WVec.Zero, -offset, palette, 1f, 1f,
|
||||
float3.Ones, TintModifiers.None, true))).ToArray();
|
||||
float3.Ones, TintModifiers.None, true)).ToArray();
|
||||
}
|
||||
|
||||
bool initialized;
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public WVec CenterOffset(World w)
|
||||
{
|
||||
var off = (w.Map.CenterOfCell(new CPos(Dimensions.X, Dimensions.Y)) - w.Map.CenterOfCell(new CPos(1, 1))) / 2;
|
||||
return (off - new WVec(0, 0, off.Z)) + LocalCenterOffset;
|
||||
return off - new WVec(0, 0, off.Z) + LocalCenterOffset;
|
||||
}
|
||||
|
||||
public BaseProvider FindBaseProvider(World world, Player p, CPos topLeft)
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var bounds = map.Bounds;
|
||||
var center = new MPos(bounds.Left + bounds.Width / 2, bounds.Top + bounds.Height / 2).ToCPos(map);
|
||||
var spawnVec = owner.HomeLocation - center;
|
||||
startPos = owner.HomeLocation + spawnVec * (Exts.ISqrt((bounds.Height * bounds.Height + bounds.Width * bounds.Width) / (4 * spawnVec.LengthSquared)));
|
||||
startPos = owner.HomeLocation + spawnVec * Exts.ISqrt((bounds.Height * bounds.Height + bounds.Width * bounds.Width) / (4 * spawnVec.LengthSquared));
|
||||
endPos = startPos;
|
||||
var spawnDirection = new WVec((self.Location - startPos).X, (self.Location - startPos).Y, 0);
|
||||
spawnFacing = spawnDirection.Yaw;
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var hpToRepair = Math.Min(Info.RepairStep, health.MaxHP - health.HP);
|
||||
|
||||
// Cast to long to avoid overflow when multiplying by the health
|
||||
var cost = Math.Max(1, (int)(((long)hpToRepair * Info.RepairPercent * buildingValue) / (health.MaxHP * 100L)));
|
||||
var cost = Math.Max(1, (int)((long)hpToRepair * Info.RepairPercent * buildingValue / (health.MaxHP * 100L)));
|
||||
|
||||
// TakeCash will return false if the player can't pay, and will stop him from contributing this Tick
|
||||
var activePlayers = Repairers.Count(player => player.PlayerActor.Trait<PlayerResources>().TakeCash(cost, true));
|
||||
|
||||
Reference in New Issue
Block a user