fixed species/cell stats

This commit is contained in:
MaxRobinsonTheGreat
2022-04-16 18:47:27 -05:00
parent a85491ce39
commit 0b5b29dff6
7 changed files with 58 additions and 49 deletions

View File

@@ -12,7 +12,6 @@ class EnvironmentController extends CanvasController{
super(env, canvas);
this.mode = Modes.FoodDrop;
this.org_to_clone = null;
this.add_new_species = false;
this.defineZoomControls();
this.scale = 1;
}
@@ -171,15 +170,15 @@ class EnvironmentController extends CanvasController{
var new_org = new Organism(col, row, this.env, organism);
if (new_org.isClear(col, row)) {
if (this.add_new_species){
let new_species = !FossilRecord.speciesIsExtant(new_org.species.name);
if (new_org.species.extinct) {
FossilRecord.resurrect(new_org.species);
}
else if (new_species) {
FossilRecord.addSpeciesObj(new_org.species);
new_org.species.start_tick = this.env.total_ticks;
this.add_new_species = false;
new_org.species.population = 0;
}
else if (this.org_to_clone.species.extinct){
FossilRecord.resurrect(this.org_to_clone.species);
}
this.env.addOrganism(new_org);
new_org.species.addPop();