Skip to content

Commit

Permalink
Added clarifying comment about the initial biome number
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyyrylainen committed Jan 12, 2019
1 parent 2d4ea98 commit 7c75e91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions scripts/microbe_stage/biome.as
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Global table which stores the current biome the player is in.
// The current biome's id. This is initially set this high because now
// the biome is only changed if the number changed. So if there ever
// are more biomes than this initial value something will break.
uint64 currentBiome = 1000000;

const Biome@ getCurrentBiome(){
Expand Down Expand Up @@ -128,16 +130,18 @@ void setSunlightForBiome(CellStageWorld@ world){
}

// Setting the current biome to a random biome selected from the biome table.
void setRandomBiome(CellStageWorld@ world){
LOG_INFO("setting random biome");
void setRandomBiome(CellStageWorld@ world)
{
LOG_INFO("setting random biome");

// Getting the size of the biome table.
// Selecting a random biome.
uint64 biome = GetEngine().GetRandom().GetNumber(0,
int(SimulationParameters::biomeRegistry().getSize()-1));

// Switching to that biome if we arent that biome already
// Switching to that biome if we arent in that biome already
if (currentBiome != biome)
{
{
setBiome(biome, world);
}
}
}
2 changes: 1 addition & 1 deletion scripts/microbe_stage/organelle_table.as
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ void setupOrganelles(){
};

_addOrganelleToTable(Organelle(nitrogenFixationProtein));

// ------------------------------------ //
// Setup the organelle letters
setupOrganelleLetters();
Expand Down

0 comments on commit 7c75e91

Please sign in to comment.