setFirstStep( prev.mpUsed == 0 );
    protected void compile(final IGame game, final Entity entity, MoveStep prev)    {        final boolean isInfantry = entity instanceof Infantry;        copy(game, prev);        // Is this the first step?        if (prev == null) {            setFirstStep( true );            prev = new MoveStep(parent, MovePath.STEP_FORWARDS);            prev.setFromEntity(entity, game);        }        switch (getType()) {            case MovePath.STEP_UNLOAD :                // Infantry in immobilized transporters get                // a special "unload stranded" game turn.                hasEverUnloaded=true;                setMp(1);                break;            case MovePath.STEP_LOAD :                setMp(1);                break;            case MovePath.STEP_TURN_LEFT :            case MovePath.STEP_TURN_RIGHT :                // Check for pavement movement.                if (Compute.canMoveOnPavement(game, prev.getPosition(),                                              getPosition())) {                    setPavementStep(true);                } else {                    setPavementStep(false);                    setOnlyPavement(false);                }                // Infantry can turn for free.                setMp( ( parent.isJumping() || isHasJustStood()                         || isInfantry ) ? 0 : 1 );                adjustFacing(getType());                break;            case MovePath.STEP_BACKWARDS :                moveInDir((getFacing() + 3) % 6);                setThisStepBackwards(true);                setRunProhibited(true);                compileMove(game, entity, prev);                break;            case MovePath.STEP_FORWARDS :            case MovePath.STEP_CHARGE :            case MovePath.STEP_DFA :            case MovePath.STEP_SWIM:                 // step forwards or backwards                moveInDir(getFacing());                setThisStepBackwards(false);                compileMove(game, entity, prev);                break;            case MovePath.STEP_LATERAL_LEFT_BACKWARDS :            case MovePath.STEP_LATERAL_RIGHT_BACKWARDS :                moveInDir(                    (MovePath                        .getAdjustedFacing(                            getFacing(),                            MovePath.turnForLateralShift(getType()))                        + 3)                        % 6);                setThisStepBackwards(true);                setRunProhibited(true);                compileMove(game, entity, prev);                setMp(getMp() + 1); //+1 for side step                break;            case MovePath.STEP_LATERAL_LEFT :            case MovePath.STEP_LATERAL_RIGHT :                moveInDir(                    MovePath.getAdjustedFacing(                        getFacing(),                        MovePath.turnForLateralShift(getType())));                setThisStepBackwards(false);                compileMove(game, entity, prev);                setMp(getMp() + 1); //+1 for side step                break;            case MovePath.STEP_GET_UP :                // mechs with 1 MP are allowed to get up                setMp(entity.getRunMP() == 1 ? 1 : 2);                setHasJustStood(true);                break;            case MovePath.STEP_GO_PRONE :                setMp(1);                break;            case MovePath.STEP_START_JUMP :                break;            case MovePath.STEP_UP :                setElevation(elevation+1);                setMp(1);                break;            case MovePath.STEP_DOWN :                 setElevation(elevation-1);                setMp(1);                break;            case MovePath.STEP_HULL_DOWN :                setMp(2);                break;            case MovePath.STEP_CLIMB_MODE_ON:                setClimbMode(true);                break;            case MovePath.STEP_CLIMB_MODE_OFF:                setClimbMode(false);                break;            default :                setMp(0);        }        // Update the entity's total MP used.        addMpUsed(getMp());        // Check for a stacking violation.        final Entity violation =            Compute.stackingViolation( game, entity.getId(), getPosition() );        if ( violation != null             && getType() != MovePath.STEP_CHARGE             && getType() != MovePath.STEP_DFA ) {            setStackingViolation(true);        }        // set moveType, illegal, trouble flags        this.compileIllegal(game, entity, prev);    }