mirror of
https://github.com/Retera/WarsmashModEngine.git
synced 2022-07-31 17:38:59 +02:00
Fix command card crashes
This commit is contained in:
parent
9f80e62ead
commit
d4595c5abc
@ -927,16 +927,18 @@ public class MeleeUI implements CUnitStateListener, CommandButtonListener, Comma
|
||||
final boolean autoCastActive, final boolean menuButton) {
|
||||
int x = Math.max(0, Math.min(COMMAND_CARD_WIDTH - 1, buttonPositionX));
|
||||
int y = Math.max(0, Math.min(COMMAND_CARD_HEIGHT - 1, buttonPositionY));
|
||||
while (this.commandCard[y][x].isVisible() && (y < COMMAND_CARD_HEIGHT) && (x < COMMAND_CARD_WIDTH)) {
|
||||
while ((x < COMMAND_CARD_WIDTH) && (y < COMMAND_CARD_HEIGHT) && this.commandCard[y][x].isVisible()) {
|
||||
x++;
|
||||
if (x >= COMMAND_CARD_WIDTH) {
|
||||
x = 0;
|
||||
y++;
|
||||
}
|
||||
}
|
||||
if((x < COMMAND_CARD_WIDTH) && (y < COMMAND_CARD_HEIGHT)) {
|
||||
this.commandCard[y][x].setCommandButtonData(icon, abilityHandleId, orderId, autoCastId, active, autoCastActive,
|
||||
menuButton);
|
||||
}
|
||||
}
|
||||
|
||||
public void resize(final Rectangle viewport) {
|
||||
this.cameraManager.resize(viewport);
|
||||
|
Loading…
Reference in New Issue
Block a user