From 144fb69a2ab7ab57873efb8d2dfc97f1303cbd3f Mon Sep 17 00:00:00 2001 From: Untrustedlife Date: Wed, 9 Jan 2019 21:08:15 -0600 Subject: [PATCH] biome.as now checks to see if you are already a certain biome before switching, if not, no need to set. Quick change to prevent potential bug fixed signed unsigned mismatch. --- scripts/microbe_stage/biome.as | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/microbe_stage/biome.as b/scripts/microbe_stage/biome.as index 8965d62499f..1819c39f50a 100644 --- a/scripts/microbe_stage/biome.as +++ b/scripts/microbe_stage/biome.as @@ -1,5 +1,5 @@ // Global table which stores the current biome the player is in. -uint64 currentBiome = 0; +uint64 currentBiome = 42; const Biome@ getCurrentBiome(){ @@ -121,9 +121,12 @@ void setRandomBiome(CellStageWorld@ world){ LOG_INFO("setting random biome"); // Getting the size of the biome table. // Selecting a random biome. - auto biome = GetEngine().GetRandom().GetNumber(0, + uint64 biome = GetEngine().GetRandom().GetNumber(0, int(SimulationParameters::biomeRegistry().getSize()-1)); - // Switching to that biome. - setBiome(biome, world); + // Switching to that biome if we arent that biome already + if (currentBiome != biome) + { + setBiome(biome, world); + } }