&& (curHex.getTerrainType() == Terrain.RUBBLE)) {
&& curHex.levelOf(Terrain.RUBBLE) > 0) {
    private void doEntityMovement(Packet c, int cn) {        final MovementData md = (MovementData)c.getObject(1);        // walk thru data, stopping when the mech is out of movement        final Entity entity = game.getEntity(c.getIntValue(0));                if (entity == null) {            // what causes this?  --Ben            return;        }                // check for fleeing        if (md.contains(MovementData.STEP_FLEE)) {            phaseReport.append("\n" + entity.getDisplayName()                       + " flees the battlefield.\n");            game.moveToGraveyard(entity.getId());            send(createRemoveEntityPacket(entity.getId()));            return;        }                // okay, proceed with movement calculations        Coords lastPos = entity.getPosition();        Coords curPos = entity.getPosition();        int curFacing = entity.getFacing();        int distance = 0;        int moveType = Entity.MOVE_NONE;        int overallMoveType = Entity.MOVE_NONE;        boolean firstStep;        boolean wasProne;        Compute.compile(game, entity.getId(), md);        // get last step's movement type        for (final Enumeration i = md.getSteps(); i.hasMoreElements();) {            final MovementData.Step step = (MovementData.Step)i.nextElement();            if (step.getMovementType() == Entity.MOVE_ILLEGAL) {                break;            } else {                overallMoveType = step.getMovementType();            }        }        // iterate through steps        firstStep = true;        for (final Enumeration i = md.getSteps(); i.hasMoreElements();) {            final MovementData.Step step = (MovementData.Step)i.nextElement();            wasProne = entity.isProne();            // stop for illegal movement            if (step.getMovementType() == Entity.MOVE_ILLEGAL) {                break;            }            // check piloting skill for getting up            if (step.getType() == MovementData.STEP_GET_UP) {                entity.heatBuildup += 1;                entity.setProne(false);                wasProne = false;                doSkillCheckInPlace(entity, new PilotingRollData(entity.getId(), 0, "getting up"), true);            } else if (firstStep) {                // running with destroyed hip or gyro needs a check                if (overallMoveType == Entity.MOVE_RUN                        && (entity.getDestroyedCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_GYRO,Mech.LOC_CT) > 0                            || entity.hasHipCrit())) {                    doSkillCheckInPlace(entity, new PilotingRollData(entity.getId(), 0, "running with damaged hip actuator or gyro"), false);                }                firstStep = false;            }            // did the entity just fall?            if (!wasProne && entity.isProne()) {                curFacing = entity.getFacing();                curPos = entity.getPosition();                break;            }                        // check for charge            if (step.getType() == MovementData.STEP_CHARGE) {                Entity target = game.getEntity(step.getPosition());                distance = step.getDistance();                entity.setCharging(true);                                pendingCharges.addElement(new ChargeAttackAction(entity.getId(), target.getId(), target.getPosition()));                break;            }            // check for dfa            if (step.getType() == MovementData.STEP_DFA) {                Entity target = game.getEntity(step.getPosition());                distance = step.getDistance();                entity.setMakingDfa(true);                                pendingCharges.addElement(new DfaAttackAction(entity.getId(), target.getId(), target.getPosition()));                break;            }            // step...            moveType = step.getMovementType();            curPos = step.getPosition();            curFacing = step.getFacing();            distance = step.getDistance();            final Hex curHex = game.board.getHex(curPos);            // check if we've moved into rubble            if (!lastPos.equals(curPos)                    && step.getMovementType() != Entity.MOVE_JUMP                    && (curHex.getTerrainType() == Terrain.RUBBLE)) {                doSkillCheckWhileMoving(entity, lastPos, curPos, new PilotingRollData(entity.getId(), 0, "entering Rubble"));            }            // check if we've moved into water            if (!lastPos.equals(curPos)                    && step.getMovementType() != Entity.MOVE_JUMP                    && curHex.getTerrainType() == Terrain.WATER                    && curHex.getElevation() < 0) {                if (curHex.getElevation() == -1) {                    doSkillCheckWhileMoving(entity, lastPos, curPos, new PilotingRollData(entity.getId(), -1, "entering Depth 1 Water"));                } else if (curHex.getElevation() == -2) {                    doSkillCheckWhileMoving(entity, lastPos, curPos, new PilotingRollData(entity.getId(), 0, "entering Depth 2 Water"));                } else {                    doSkillCheckWhileMoving(entity, lastPos, curPos, new PilotingRollData(entity.getId(), 1, "entering Depth 3+ Water"));                }            }            // did the entity just fall?            if (!wasProne && entity.isProne()) {                curFacing = entity.getFacing();                curPos = entity.getPosition();                break;            }            // update lastPos            lastPos = new Coords(curPos);        }        // set entity parameters        entity.setPosition(curPos);        entity.setFacing(curFacing);        entity.setSecondaryFacing(curFacing);        entity.delta_distance = distance;        entity.moved = moveType;        // but the danger isn't over yet!  landing from a jump can be risky!        if (overallMoveType == Entity.MOVE_JUMP && !entity.isMakingDfa()) {            // check for damaged criticals            if (entity.getDestroyedCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_GYRO,Mech.LOC_CT) > 0 || entity.hasLegActuatorCrit()) {                doSkillCheckInPlace(entity, new PilotingRollData(entity.getId(), 0, "landing with damaged leg actuator or gyro"), false);            }        }        // build up heat from movement        if (moveType == Entity.MOVE_WALK) {            entity.heatBuildup += 1;        } else if (moveType == Entity.MOVE_RUN) {            entity.heatBuildup += 2;        } else if (moveType == Entity.MOVE_JUMP) {            entity.heatBuildup += Math.max(3, distance);        }        entity.ready = false;        // duhh.. send an outgoing packet to everybody        send(createEntityPacket(entity.getId()));    }