Fixed client crash on corrupted map

This commit is contained in:
LemADEC 2015-11-13 21:52:22 +01:00
parent 7de3ab0439
commit baf8a25057

View file

@ -61,10 +61,8 @@ public class BlockShipController extends BlockContainer {
if (metadata == 0) { // Inactive state
return iconBuffer[ICON_INACTIVE_SIDE];
} else if (metadata > 0) { // Activated, in metadata stored mode number
if (ICON_SIDE_ACTIVATED + metadata - 1 < iconBuffer.length) {
if (ICON_SIDE_ACTIVATED + metadata < iconBuffer.length) {
return iconBuffer[ICON_SIDE_ACTIVATED + metadata];
} else {
return null;
}
}