mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-03-02 10:41:29 +01:00
Merge pull request #389 from mikeprimm/master
Check for raw biome lookup overflows - prevent array exceptions on some worlds
This commit is contained in:
commit
82b7a87a7c
@ -885,8 +885,11 @@ public class TexturePack {
|
||||
}
|
||||
|
||||
private static final int biomeLookup(int[] argb, int width, double rainfall, double temp) {
|
||||
int t = (int)((1.0-temp)*(width-1));
|
||||
int h = width - (int)(temp*rainfall*(width-1)) - 1;
|
||||
int w = width-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];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user