Skip to content

Commit

Permalink
biome.as now checks to see if you are already a certain biome before …
Browse files Browse the repository at this point in the history
…switching, if not, no need to set.

Quick change to prevent potential bug

fixed signed unsigned mismatch.
  • Loading branch information
Untrustedlife authored and hhyyrylainen committed Jan 12, 2019
1 parent 7a015d1 commit 144fb69
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/microbe_stage/biome.as
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Global table which stores the current biome the player is in.
uint64 currentBiome = 0;
uint64 currentBiome = 42;

const Biome@ getCurrentBiome(){

Expand Down Expand Up @@ -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);
}
}

0 comments on commit 144fb69

Please sign in to comment.