From 589e673aa909120d2f1e9ded9b7f5c941dd6e02b Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sun, 16 Aug 2015 23:09:03 +0200 Subject: [PATCH] Replace the float WaterChance by an integer percentage --- OpenRA.Mods.Common/Traits/World/CrateSpawner.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/World/CrateSpawner.cs b/OpenRA.Mods.Common/Traits/World/CrateSpawner.cs index 27c5021b83..9ead8be8f8 100644 --- a/OpenRA.Mods.Common/Traits/World/CrateSpawner.cs +++ b/OpenRA.Mods.Common/Traits/World/CrateSpawner.cs @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits public readonly HashSet ValidWater = new HashSet { "Water" }; [Desc("Chance of generating a water crate instead of a land crate.")] - public readonly float WaterChance = .2f; + public readonly int WaterChance = 20; [ActorReference] [Desc("Crate actors to drop")] @@ -94,7 +94,7 @@ namespace OpenRA.Mods.Common.Traits void SpawnCrate(Actor self) { - var inWater = self.World.SharedRandom.NextFloat() < info.WaterChance; + var inWater = self.World.SharedRandom.Next(100) < info.WaterChance; var pp = ChooseDropCell(self, inWater, 100); if (pp == null)