Fix IDE0004
This commit is contained in:
@@ -181,7 +181,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
|
||||
return !double.IsNaN(attackChance) && attackChance < 30.0;
|
||||
}
|
||||
|
||||
static float NormalizedHealth(IEnumerable<Actor> actors, float normalizeByValue)
|
||||
static float NormalizedHealth(IEnumerable<Actor> actors, int normalizeByValue)
|
||||
{
|
||||
var sumOfMaxHp = 0;
|
||||
var sumOfHp = 0;
|
||||
|
||||
@@ -109,8 +109,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var sellValue = self.GetSellValue();
|
||||
|
||||
// Cast to long to avoid overflow when multiplying by the health
|
||||
var hp = health != null ? (long)health.Value.HP : 1L;
|
||||
var maxHP = health != null ? (long)health.Value.MaxHP : 1L;
|
||||
var hp = health != null ? health.Value.HP : 1L;
|
||||
var maxHP = health != null ? health.Value.MaxHP : 1L;
|
||||
var refund = (int)(sellValue * info.RefundPercent * hp / (100 * maxHP));
|
||||
|
||||
return "Refund: $" + refund;
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var content = resources[cell];
|
||||
var oldDensity = content.Type == resourceInfo.ResourceIndex ? content.Index : 0;
|
||||
var density = (byte)Math.Min(resourceInfo.MaxDensity, oldDensity + amount);
|
||||
Map.Resources[cell] = new ResourceTile((byte)resourceInfo.ResourceIndex, density);
|
||||
Map.Resources[cell] = new ResourceTile(resourceInfo.ResourceIndex, density);
|
||||
|
||||
return density - oldDensity;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user