Fix crashing when terrain.png is not same as terrain.png height (Thanks kingoscargames1)

This commit is contained in:
UnknownShadow200 2018-01-16 06:24:45 +11:00
parent 983a5433ab
commit 9095bbb3b5

View file

@ -45,6 +45,11 @@ namespace ClassicalSharp {
public bool ChangeTerrainAtlas(Bitmap atlas) {
if (!ValidateBitmap("terrain.png", atlas)) return false;
if (atlas.Width != atlas.Height) {
Chat.Add("&cUnable to use terrain.png from the texture pack.");
Chat.Add("&c Its width is not the same as its height.");
return false;
}
if (Graphics.LostContext) return false;
LoadAtlas(atlas);