Open Mudbill opened 3 months ago
The game shouldn't crash at all upon a runtime exception, so that should definitely be fixed even if the off by one error isn't.
Was this run into while playing without debug mode? Might be related to some previous crashes that occured when the debug window wasn't present.
Never mind, red herring. Confirmed to be a different issue relating to pointers.
There's a BlackBox crash to desktop occurring in the Entrance Hall map after completing the Archives. It happens at the end of the Shadow slime spawning event.
Based on what I've looked into, I suspect it's caused by an array out of bounds exception in the .hps script file. It's possible this error has existing since the dawn of time, but previously the game would simply halt a function when such an exception occurred. It seems this is no longer the case with the new exception detection features, and could be causing the crash.
hpl.log prints this upon crashing:
The relevant script for 02_entrance_hall.hps is this:
Line 161 is the first for-loop:
for(int iSlime=0;iSlime<=aSlime.length();iSlime++) {
I think the issue is that it's "off-by-one" in that it gets
aSlime[iSlime]
wheniSlime
is equal to the length of theaSlime
array, due to it looping as long as it is "less than or equal" instead of just "less than."