mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 13:15:30 +01:00
Check for overflow on biome lookup - prevent exceptions on some worlds
This commit is contained in:
parent
89525c38d5
commit
48ba43aae5
@ -885,8 +885,11 @@ public class TexturePack {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static final int biomeLookup(int[] argb, int width, double rainfall, double temp) {
|
private static final int biomeLookup(int[] argb, int width, double rainfall, double temp) {
|
||||||
int t = (int)((1.0-temp)*(width-1));
|
int w = width-1;
|
||||||
int h = width - (int)(temp*rainfall*(width-1)) - 1;
|
int t = (int)((1.0-temp)*w);
|
||||||
|
int h = (int)((1.0 - (temp*rainfall))*w);
|
||||||
|
if(h > w) h = w;
|
||||||
|
if(t > w) t = w;
|
||||||
return argb[width*h + t];
|
return argb[width*h + t];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user