entNum = game.getNextEntityNum(getLocalPlayer(), entNum);
entNum = game.getNextEntityNum(entNum);
    public void calculateFiringTurn()    {        // just take the first unit that hasn't fired yet and do it        int entNum = game.getFirstEntityNum(getLocalPlayer());        Entity en = game.getEntity(entNum);	boolean infMoveLast = game.getOptions().booleanOption("inf_move_last");	boolean infMoveMulti = game.getOptions().booleanOption("inf_move_multi");	// Are we firing a non-Infantry entity in	// the middle of an Infantry block?	if ( infMoveMulti && (turnInfMoved % Game.INF_MOVE_MULTI) > 0 &&	     !(en instanceof Infantry) ) {	    // Does this player still have infantry to fire?	    if ( game.hasInfantry(this.local_pn) ) {		// Yup.  Find an Infantry entity.		while ( !(en instanceof Infantry ) ) {		    entNum = game.getNextEntityNum(getLocalPlayer(), entNum);		    en = game.getEntity(entNum);		}	    }	    else {		// Nope.  Reset the infantry counter.		turnInfMoved = 0;	    }	} // End check-inf_move_multi        Vector firV = new Vector();        for (Enumeration i = en.getWeapons();i.hasMoreElements();) {            Mounted mw = (Mounted)i.nextElement();             FiringOption fo = calculateOneWeaponDamagePotential(entNum, mw);             if (fo != null) firV.addElement(fo);        }                FiringOption[] firOpts = new FiringOption[firV.size()];        firV.copyInto(firOpts);        // rank order firing options according to damage potential,        // and fire them in order, skipping weapons tht would exceed        // the heat limit.        sortFiringOptions(firOpts);        int capacity = en.getHeatCapacityWithWater();        int currentHeat = en.heatBuildup;                int allowableHeatLevel = 5; // dunno.  pick a number.        Vector attacks = new Vector();        for (int i = 0;i<firOpts.length;i++) {            if (currentHeat + ((WeaponType)firOpts[i].weapon.getType()).getHeat() - capacity <= allowableHeatLevel) {                attacks.addElement(new WeaponAttackAction(                        entNum,                         game.getEntityID(firOpts[i].target), en.getEquipmentNum(firOpts[i].weapon)));                currentHeat += ((WeaponType)firOpts[i].weapon.getType()).getHeat();            }        }        sendAttackData(entNum, attacks);    }