if ( isInfantry && step.getMpUsed() == 0 ) { firstStep = true; }
    private static void compileIllegal(Game game, int entityId, MovementData md,                                         int overallMoveType, boolean runProhibited) {        final Entity entity = game.getEntity(entityId);        Coords curPos = new Coords(entity.getPosition());        boolean legal = true;        boolean danger = false;        boolean pastDanger = false;        boolean firstStep = true;                for (final Enumeration i = md.getSteps(); i.hasMoreElements();) {            final MovementData.Step step = (MovementData.Step)i.nextElement();                        Coords lastPos = new Coords(curPos);            curPos = step.getPosition();                        // guilty until proven innocent            int moveType = Entity.MOVE_ILLEGAL;                        // check for valid jump mp            if (overallMoveType == Entity.MOVE_JUMP                 && step.getMpUsed() <= entity.getJumpMPWithTerrain()                && !entity.isProne()) {                moveType = Entity.MOVE_JUMP;            }                        // check for valid walk/run mp            if ((overallMoveType == Entity.MOVE_WALK || overallMoveType == Entity.MOVE_RUN)                && (!entity.isProne() || md.contains(MovementData.STEP_GET_UP)                    || step.getType() == MovementData.STEP_TURN_LEFT                     || step.getType() == MovementData.STEP_TURN_RIGHT)) {                if (step.getMpUsed() <= entity.getWalkMP()) {                    moveType = Entity.MOVE_WALK;                } else if (step.getMpUsed() <= entity.getRunMP() && !runProhibited) {                    moveType = Entity.MOVE_RUN;                }            }                        // mechs with 1 MP are allowed to get up            if (step.getType() == MovementData.STEP_GET_UP && entity.getWalkMP() == 1) {                moveType = Entity.MOVE_RUN;            }                        // amnesty for the first step            if (firstStep && moveType == Entity.MOVE_ILLEGAL && entity.getWalkMP() > 0 && !entity.isProne() && step.getType() == MovementData.STEP_FORWARDS) {                moveType = Entity.MOVE_RUN;            }                        // check if this movement is illegal for reasons other than points            if (!isMovementPossible(game, entityId, lastPos, curPos, moveType, step.getType(), firstStep)) {                moveType = Entity.MOVE_ILLEGAL;            }                        // no legal moves past an illegal one            if (moveType == Entity.MOVE_ILLEGAL) {                legal = false;            }                        // check for danger            danger = step.isDanger();            danger |= isPilotingSkillNeeded(game, entityId, lastPos,                                               curPos, moveType);                        // getting up is also danger            if (step.getType() == MovementData.STEP_GET_UP) {                danger = true;            }                        // set flags            step.setDanger(danger);            step.setPastDanger(pastDanger);            step.setMovementType(legal ? moveType : Entity.MOVE_ILLEGAL);                        // set past danger            pastDanger |= danger;                        firstStep = false;        }    }