Commit 1dd147b
authored
[rend2] fixed crash without causing clumping
See issue #1189
The game will crash, if a map features weather (e.g. vjun1) and you noclip far enough beneath the map.
This was caused by an out-of-bounds exception caused by chunkIndex sometimes being negative.
The code change ensures the result is always in the range [0, 2] for each axis. This makes sure chunkIndex is always in [0, 8], which is safe for zoneOffsets[9].1 parent e934a34 commit 1dd147b
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1141 | 1141 | | |
1142 | 1142 | | |
1143 | 1143 | | |
1144 | | - | |
1145 | | - | |
| 1144 | + | |
| 1145 | + | |
1146 | 1146 | | |
1147 | 1147 | | |
1148 | 1148 | | |
| |||
0 commit comments