mirror of
https://github.com/GTNewHorizons/Avaritia.git
synced 2026-11-20 20:22:18 +00:00
Clamp lightcolor to prevent ArrayIndexOutOfBounds (#62)
This commit is contained in:
1 parent
cd09920557
commit
69b6bc0560
1 file changed
+1
-1
@@ -84,7 +84,7 @@ public class CosmicRenderShenanigans {
|
||||
int mx = (coord % 65536) / 16;
|
||||
int my = (coord / 65536) / 16;
|
||||
|
||||
int lightcolour = map[my * 16 + mx];
|
||||
int lightcolour = map[Math.max(0, Math.min(map.length - 1, my * 16 + mx))];
|
||||
|
||||
setLightLevel(
|
||||
((lightcolour >> 16) & 0xFF) / 256.0f,
|
||||
|
||||
Reference in new issue
Block a user