Closed kanethemediocre closed 3 years ago
This don't work. On "while (j<this.shops[i].missions.length){" it says that it can't read property missions of undefined. Not sure why this.shops[i] would be undefined here.
nextjob(){ var nextjob = "No job"; var i = 0; while (i<this.shops.length){ var j = 0; while (j<this.shops[i].missions.length){ if (this.shops[i].missions[j].taken){ nextjob = this.shops[i].missions[j].message; j = this.shops[i].missions.length; i = this.shops.length; } j=j+1; } i=i+1; } return nextjob; }
Totally redid this from scratch, and while it makes the computer work a little harder than it should need to, it does work. Further refinement might include a means of showing the player ALL jobs taken in the system that have not been completed, and/or selecting which job is listed as the current job. Also, this currently re-checks every frame, and it should only need to update when a job is taken or completed.
Still shows completed job as if current. Reward and radio message work fine.