// check for shifty goodness
boolean shiftheld = (b.getModifiers() & InputEvent.SHIFT_MASK) != 0;
// check for a deployment
Coords moveto = b.getCoords();
if ((ce().getPosition() != null) && (shiftheld || turnMode)) { // turn
ce().setFacing(ce().getPosition().direction(moveto));
ce().setSecondaryFacing(ce().getFacing());
clientgui.bv.redrawEntity(ce());
turnMode = false;
} else if(ce().isBoardProhibited(client.game.getBoard().getType())) {
//check if this type of unit can be on the given type of map
AlertDialog dlg = new AlertDialog(clientgui.frame,
Messages.getString("DeploymentDisplay.alertDialog.title"), //$NON-NLS-1$
Messages
.getString(
"DeploymentDisplay.wrongMapType", new Object[] { ce().getShortName(), Board.getTypeName(client.game.getBoard().getType()) })); //$NON-NLS-1$
dlg.setVisible(true);
return;
} else if (!(client.game.getBoard().isLegalDeployment(moveto,
ce().getOwner()) || assaultDropPreference)
|| ce().isHexProhibited(client.game.getBoard().getHex(moveto))) {
JOptionPane
.showMessageDialog(
clientgui.frame,
Messages
.getString(
"DeploymentDisplay.cantDeployInto", new Object[] { ce().getShortName(), moveto.getBoardNum() }), Messages.getString("DeploymentDisplay.alertDialog.title") //$NON-NLS-1$
, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$
return;
} else if((ce() instanceof Aero) && client.game.getBoard().inAtmosphere() &&
(ce().getElevation() <= client.game.getBoard().getHex(moveto).ceiling())) {
//make sure aeros don't end up at a lower elevation than the current hex
JOptionPane
.showMessageDialog(
clientgui.frame,
Messages
.getString(
"DeploymentDisplay.elevationTooLow", new Object[] { ce().getShortName(), moveto.getBoardNum() }), Messages.getString("DeploymentDisplay.alertDialog.title") //$NON-NLS-1$
, JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$
return;
} else if (Compute.stackingViolation(client.game, ce().getId(), moveto) != null) {
// check if deployed unit violates stacking
return;