NetLogo / Tortoise

Compiler and runtime engine for NetLogo models that runs in JavaScript 🐢
https://netlogoweb.org
Other
56 stars 27 forks source link

`hatch-<breed>` should initialize new `<breeds>-own` variables to 0 #186

Closed TheBizzle closed 7 years ago

TheBizzle commented 7 years ago

Dor Abrahamson writes:

http://www.netlogoweb.org/launch#http://www.netlogoweb.org/assets/modelslib/Curricular%20Models/ProbLab/4%20Block%20Stalagmites.nlogo

Setup Go Organize

“Error Checking equality on undefined is an invalid condition”

The problem stems from the fact that hatch-sample-organizers is being called by sample-dudes, while sample-organizers have the variable original-pycor, but sample-dudes do not. original-pycor is being initialized to undefined, rather than 0. The malfeasant line is here, where no effort is made to do anything sensible if the new variable didn't actually exist in the old hatcher's breed.

Fix incoming shortly.

SethTisue commented 7 years ago

is there missing test coverage for this back in the main NetLogo repo?

TheBizzle commented 7 years ago

There was. I've added a test for it now.

TheBizzle commented 7 years ago

Fixed by d0f8377.