I’ve seen a couple posts asking about this but most were a little convoluted… This one’s pretty straightforward. I’m using Unity 3.5.7 still - eventually I’ll upgrade but I’ve been going strong with what I’ve got and I don’t currently see a compelling reason to upgrade.
Anyway, I’m working on a tricky bit of pathfinding and so I started debugging and started noticing something very strange.
Here’s the code:
if(fromIslandI == islands.Count) {
this.status = IslandBuildStatus.COMPLETE;
return;
}
Hrm, maybe I spoke too soon. Even though it claims to be executing that line of code, the status isn’t being changed.
The this.status setting line was being skipped when I debugged. Looking at the locals I can confirm that its value never changed to COMPLETE and a check in the method that called this didn’t enter a block that it should have had the status been COMPLETE.
I removed the return; and suddenly the status is getting set correctly.
What the heck??