if (entity.getBadCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_GYRO, Mech.LOC_CT) > 1 && !isFirstStep() ) movementType = Entity.MOVE_ILLEGAL;
if (entity.getBadCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_GYRO, Mech.LOC_CT) > 1 && !isFirstStep() ) { movementType = Entity.MOVE_ILLEGAL; }
    void compileIllegal(final Game game, final Entity entity, final MoveStep prev) {        final int stepType = getType();        Coords curPos = getPosition();        Coords lastPos = entity.getPosition();        boolean isUnjammingRAC = entity.isUnjammingRAC();        // Is this the first step?        if (null == prev) {            setFirstStep(true);        } else {            // infantry get a first step if all they've done is spin on the            // spot:            //   getMpUsed() is the MPs used in the whole MovePath            //   getMp() is the MPs used in the last (illegal) step (this step)            //   if the difference between the whole path and this step is 0            //   then this must be their first step            setFirstStep(parent.isInfantry() && (getMpUsed() - getMp()) == 0);            prevStepOnPavement = prev.isPavementStep();            isTurning = prev.isTurning();            isUnloaded = prev.isUnloaded();            lastPos = prev.getPosition();        }        // guilty until proven innocent        movementType = Entity.MOVE_ILLEGAL;        // check for ejection (always legal?)        if (type == MovePath.STEP_EJECT) {            movementType = Entity.MOVE_NONE;        }        // check for valid jump mp        if (parent.isJumping() && getMpUsed() <= entity.getJumpMPWithTerrain() && !isProne()            && !(entity instanceof Protomech && entity.getInternal(Protomech.LOC_LEG) == Protomech.ARMOR_DESTROYED)) {            movementType = Entity.MOVE_JUMP;        }                // legged Protos may make one facing change        if (isFirstStep()            && entity instanceof Protomech            && entity.getInternal(Protomech.LOC_LEG) == Protomech.ARMOR_DESTROYED            && (stepType == MovePath.STEP_TURN_LEFT                 || stepType == MovePath.STEP_TURN_RIGHT)) {            movementType = Entity.MOVE_WALK;        }                    // check for valid walk/run mp        if (!parent.isJumping()            && (!isProne()                || parent.contains(MovePath.STEP_GET_UP)                || stepType == MovePath.STEP_TURN_LEFT                || stepType == MovePath.STEP_TURN_RIGHT)) {            if (getMpUsed() <= entity.getWalkMP()) {                movementType = Entity.MOVE_WALK;            // Vehicles moving along pavement get "road bonus" of 1 MP.            // ASSUMPTION : bonus MP is to walk, which may me 2 MP to run.                            } else if (entity instanceof Tank && isOnlyPavement() && getMpUsed() == entity.getWalkMP() + 1) {                movementType = Entity.MOVE_WALK;            } else if (getMpUsed() <= entity.getRunMPwithoutMASC() && !isRunProhibited()) {                movementType = Entity.MOVE_RUN;            } else if (getMpUsed() <= entity.getRunMP() && !isRunProhibited()) {                setUsingMASC(true);                Mech m = (Mech) entity;                setTargetNumberMASC(m.getMASCTarget());                movementType = Entity.MOVE_RUN;            } else if (                entity instanceof Tank                    && isOnlyPavement()                    && getMpUsed() <= entity.getRunMP() + (entity.getWalkMP() % 2 == 1 ? 1 : 2)                    && !isRunProhibited()) {                movementType = Entity.MOVE_RUN;            }        }            	// Mechs with busted Gyro may make only one facing change    	if (entity.getBadCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_GYRO, Mech.LOC_CT) > 1    		&& !isFirstStep() )    		movementType = Entity.MOVE_ILLEGAL;			        // mechs with 1 MP are allowed to get up, except if they've used that 1MP up already        if (MovePath.STEP_GET_UP==stepType && 1==entity.getRunMP() && entity.mpUsed<1) {            movementType = Entity.MOVE_RUN;        }        // amnesty for the first step        if (isFirstStep()            && movementType == Entity.MOVE_ILLEGAL            && entity.getWalkMP() > 0            && !entity.isProne()            && stepType == MovePath.STEP_FORWARDS) {            movementType = Entity.MOVE_RUN;        }                // Is the entity unloading passeners?        if (stepType == MovePath.STEP_UNLOAD) {            // Prone Meks are able to unload, if they have the MP.            if (getMpUsed() <= entity.getRunMP() && entity.isProne() && movementType == Entity.MOVE_ILLEGAL) {                movementType = Entity.MOVE_RUN;                if (getMpUsed() <= entity.getWalkMP()) {                    movementType = Entity.MOVE_WALK;                }            }            // Can't unload units into prohibited terrain            // or into stacking violation.            Targetable target = getTarget(game);            if (target instanceof Entity) {                Entity other = (Entity) target;                if (null != Compute.stackingViolation(game, other, curPos, entity)                    || other.isHexProhibited(game.board.getHex(curPos))) {                    movementType = Entity.MOVE_ILLEGAL;                }            } else {                System.err.print("Trying to unload ");                System.err.print(target.getDisplayName());                System.err.print(" from ");                System.err.print(entity.getDisplayName());                System.err.println(".");                movementType = Entity.MOVE_ILLEGAL;            }        }        // Can't run or jump if unjamming a RAC.        if (isUnjammingRAC && (movementType == Entity.MOVE_RUN || parent.isJumping())) {            movementType = Entity.MOVE_ILLEGAL;        }        // only standing mechs may go prone        if (stepType == MovePath.STEP_GO_PRONE && (isProne() || !(entity instanceof Mech))) {            movementType = Entity.MOVE_ILLEGAL;        }        // check if this movement is illegal for reasons other than points        if (!isMovementPossible(game, lastPos) || isUnloaded) {            movementType = Entity.MOVE_ILLEGAL;        }        if (prev != null && !prev.isLegal()) {            movementType = Entity.MOVE_ILLEGAL;        }        if (movementType == Entity.MOVE_ILLEGAL) {            return;        }        danger            |= Compute.isPilotingSkillNeeded(                game,                entity.getId(),                lastPos,                curPos,                movementType,                isTurning,                prevStepOnPavement);        // getting up is also danger        if (stepType == MovePath.STEP_GET_UP) {            danger = true;        }        // set past danger        pastDanger |= danger;        // Record if we're turning *after* check for danger,        // because the danger lies in moving *after* turn.        switch (stepType) {            case MovePath.STEP_TURN_LEFT :            case MovePath.STEP_TURN_RIGHT :                setTurning(true);                break;            case MovePath.STEP_UNLOAD :                // Unloading must be the last step.                setUnloaded(true);                break;            default :                setTurning(false);                break;        }        // update prone state        if (stepType == MovePath.STEP_GO_PRONE) {            setProne(true);        } else if (stepType == MovePath.STEP_GET_UP) {            setProne(false);        }    }