Open x-qq opened 4 years ago
More precisely, it's trying to access the next sector to the south, which doesn't exist. We either need to enable "dummy" values if the view scrolls off the edge of the map, or have some special case so that it doesn't scroll at all when you're at the edge.
You could also use a system like what Realmz does here: setting invalid map sectors to ID -1, and checking for that ID before attempting to load an adjacent section. If there’s no sector there, don’t scroll the map past what would be the transition point.
I think that's basically the sort of idea I meant here:
have some special case so that it doesn't scroll at all when you're at the edge.
The other method is probably easier, but then you'd see blackness or something beyond the edge. On the other hand, that might be okay - scenarios are supposed to be structured so you can't get that close, anyway. As long as it doesn't crash…
Loading this save file and moving south in the current build, I don't get a crash.
Responding to what you said on IRC…
[01:45am] NQNStudios: celticminstrel did outdoor sections used to be 96x96 tiles? [01:46am] NQNStudios: I reproduced this bug by making a scenario with no walls blocking the south boundary https://github.com/calref/cboe/issues/240 [01:46am] NQNStudios: it's boundary checking for 96, but the outdoor section is actually 48x48 [02:02am] NQNStudios: ohhhhh would it be 96 because multiple sections could be in the vector it's checking?
The original game loads 4 outdoor sections into a 96x96 combined grid, shifting them as you move around the outdoors. I don't think I remember altering that aspect.
The issue was identifies as trying to check if the tile has a road in a next sector to the south.
Save attached - move 1 tile south.
zkr_road_check_crash.exg.zip
Backtrace: