movementType = IEntityMovementType.MOVE_RUN;
if (parent.getEntity().getMovementMode() == IEntityMovementMode.VTOL) movementType = IEntityMovementType.MOVE_VTOL_RUN; else movementType = IEntityMovementType.MOVE_RUN;
    void compileIllegal(final IGame game, final Entity entity,                        final MoveStep prev) {        final int stepType = getType();        final boolean isInfantry = entity instanceof Infantry;        Coords curPos = getPosition();        Coords lastPos = prev.getPosition();        boolean isUnjammingRAC = entity.isUnjammingRAC();        // Infantry get a first step if all they've done is spin on the spot.        if (isInfantry && (getMpUsed() - getMp()) == 0) {            setFirstStep( true );            //   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            // TODO : Why are these *here*???            prevStepOnPavement = prev.isPavementStep();            isTurning = prev.isTurning();            isUnloaded = prev.isUnloaded();        }        // guilty until proven innocent        movementType = IEntityMovementType.MOVE_ILLEGAL;        // check for ejection (always legal?)        if (type == MovePath.STEP_EJECT) {            movementType = IEntityMovementType.MOVE_NONE;        }        // check for valid jump mp        if ( parent.isJumping()             && getMpUsed() <= entity.getJumpMPWithTerrain()             && !isProne()             && !( entity instanceof Protomech                   && (entity.getInternal(Protomech.LOC_LEG)                       == IArmorState.ARMOR_DESTROYED) )             && !entity.isStuck() ) {            movementType = IEntityMovementType.MOVE_JUMP;        }                // legged Protos may make one facing change        if (isFirstStep()            && entity instanceof Protomech            && (entity.getInternal(Protomech.LOC_LEG)                == IArmorState.ARMOR_DESTROYED)            && (stepType == MovePath.STEP_TURN_LEFT                 || stepType == MovePath.STEP_TURN_RIGHT)            && !entity.isStuck()) {            movementType = IEntityMovementType.MOVE_WALK;        }                    // check for valid walk/run mp        if (!parent.isJumping()            && !entity.isStuck()            && entity.getWalkMP() > 0            && (!isProne()                || parent.contains(MovePath.STEP_GET_UP)                || stepType == MovePath.STEP_TURN_LEFT                || stepType == MovePath.STEP_TURN_RIGHT)) {            if (getMpUsed() <= entity.getWalkMP()) {                movementType = IEntityMovementType.MOVE_WALK;            // Vehicles moving along pavement get "road bonus" of 1 MP.            // N.B. The Ask Precentor Martial forum said that a 4/6            //      tank on a road can move 5/7, **not** 5/8.            } else if (entity instanceof Tank && !(entity instanceof VTOL) && isOnlyPavement()                       && getMpUsed() == entity.getWalkMP() + 1) {                movementType = IEntityMovementType.MOVE_WALK;                // store if we got the pavement Bonus for end of phase                // gravity psr                entity.gotPavementBonus = true;            } else if (getMpUsed() <= entity.getRunMPwithoutMASC()                       && !isRunProhibited()) {                movementType = IEntityMovementType.MOVE_RUN;            } else if (getMpUsed() <= entity.getRunMP()                       && !isRunProhibited()) {                setUsingMASC(true);                Mech m = (Mech) entity;                setTargetNumberMASC(m.getMASCTarget());                movementType = IEntityMovementType.MOVE_RUN;            } else if (                entity instanceof Tank                    && !(entity instanceof VTOL)                    && isOnlyPavement()                    && getMpUsed() <= (entity.getRunMP() + 1)                    && !isRunProhibited()) {                movementType = IEntityMovementType.MOVE_RUN;                // store if we got the pavement Bonus for end of phase                // gravity psr                entity.gotPavementBonus = true;            }        }        /*        if(MovePath.STEP_DOWN==stepType) {            if(entity instanceof VTOL) {                if(!(((VTOL)entity).canGoDown(elevation+1,getPosition()))) {                    movementType = IMoveType.MOVE_ILLEGAL;//We can't intentionally crash.                }            } else {                movementType = IMoveType.MOVE_ILLEGAL;//only VTOLs can go up and down (and subs, but we don't have any.)            }        }        if(MovePath.STEP_UP==stepType) {            if(!(entity instanceof VTOL)) {                movementType = IMoveType.MOVE_ILLEGAL;            }        }*///not needed due to isMovementPossible, right?        // 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 = IEntityMovementType.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 && !entity.isStuck()) {            movementType = IEntityMovementType.MOVE_RUN;        }        // amnesty for the first step        if (isFirstStep()            && movementType == IEntityMovementType.MOVE_ILLEGAL            && entity.getWalkMP() > 0            && !entity.isProne()            && !entity.isStuck()            && stepType == MovePath.STEP_FORWARDS) {            movementType = IEntityMovementType.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 == IEntityMovementType.MOVE_ILLEGAL) {                movementType = IEntityMovementType.MOVE_RUN;                if (getMpUsed() <= entity.getWalkMP()) {                    movementType = IEntityMovementType.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.getBoard().getHex(curPos))) {                    movementType = IEntityMovementType.MOVE_ILLEGAL;                }            } else {                movementType = IEntityMovementType.MOVE_ILLEGAL;            }        }        // Can't run or jump if unjamming a RAC.        if (isUnjammingRAC && (movementType == IEntityMovementType.MOVE_RUN                               || parent.isJumping())) {            movementType = IEntityMovementType.MOVE_ILLEGAL;        }        // only standing mechs may go prone        if (stepType == MovePath.STEP_GO_PRONE            && (isProne() || !(entity instanceof Mech) || entity.isStuck())) {            movementType = IEntityMovementType.MOVE_ILLEGAL;        }                        // check if this movement is illegal for reasons other than points        if (!isMovementPossible(game, lastPos) || isUnloaded) {            movementType = IEntityMovementType.MOVE_ILLEGAL;        }        // If the previous step is always illegal, then so is this one        if ( prev != null && IEntityMovementType.MOVE_ILLEGAL == prev.movementType ) {            movementType = IEntityMovementType.MOVE_ILLEGAL;        }        // Don't compute danger if the step is illegal.        if (movementType == IEntityMovementType.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);        }    }