Buggy code:
protected ComplexAgentInfo info ; protected int pregPeriod ; protected boolean pregnant = false ; public static final int LOOK_DISTANCE = 4 ; protected long currTick = 0 ; private static ColorLookup colorMap = TypeColorEnumeration . getInstance ( ) ; protected static Set < ContactMutator > contactMutators = new LinkedHashSet < ContactMutator > ( ) ; protected static Set < StepMutator > stepMutators = new LinkedHashSet < StepMutator > ( ) ; private static final Direction [ ] dirList = new Direction [ ] { Environment . DIRECTION_NORTH , Environment . DIRECTION_SOUTH , Environment . DIRECTION_WEST , Environment . DIRECTION_EAST , Environment . DIRECTION_NORTHEAST , Environment . DIRECTION_SOUTHEAST , Environment . DIRECTION_NORTHWEST , Environment . DIRECTION_SOUTHWEST } ; public static void addMutator ( AgentMutator mutator ) { } public static void clearMutators ( ) { } protected Direction facing = Environment . DIRECTION_NORTH ; private static Set < SpawnMutator > spawnMutators = new LinkedHashSet < SpawnMutator > ( ) ; protected boolean mustFlip = false ; public transient ComplexEnvironment environment ; public ComplexAgent ( ) { } public void init ( org . cobweb . cobweb2 . core . Location pos , ComplexAgent parent1 , ComplexAgent parent2 ) { } protected void init ( org . cobweb . cobweb2 . core . Location pos , ComplexAgent parent ) { } public void init ( int agentT , ComplexAgentParams agentData , ProductionParams prodData , Direction facingDirection , Location pos ) { } public void init ( int agentType , Location pos , ComplexAgentParams agentData , ProductionParams prodData ) { } private void afterTurnAction ( ) { } void broadcastCheating ( int cheaterID ) { } protected void broadcastFood ( org . cobweb . cobweb2 . core . Location loc ) { } protected boolean canBroadcast ( ) { } public boolean canEat ( org . cobweb . cobweb2 . core . Location destPos ) { } protected boolean canEat ( ComplexAgent adjacentAgent ) { } protected boolean canStep ( Location destPos ) { } boolean checkCredibility ( long agentId ) { } BroadcastPacket checkforBroadcasts ( ) { } protected void communicate ( ComplexAgent target ) { } public void copyConstants ( ComplexAgent p ) { } @ Override public void die ( ) { } public ComplexAgent . SeeInfo distanceLook ( ) { } public void eat ( org . cobweb . cobweb2 . core . Location destPos ) { } protected void eat ( ComplexAgent adjacentAgent ) { } public double energyPenalty ( ) { } protected Agent getAdjacentAgent ( ) { } public long getAge ( ) { } @ Override public boolean getAgentPDActionCheat ( ) { } public int getAgentType ( ) { } @ Override public Color getColor ( ) { } public int getCommInbox ( ) { } public int getCommOutbox ( ) { } @ Override public void getDrawInfo ( DrawingHandler theUI ) { } @ Override public int getEnergy ( ) { } public ComplexAgentInfo getInfo ( ) { } public int getIntFacing ( ) { } public Direction getFacing ( ) { } public int getMemoryBuffer ( ) { } private void InitFacing ( ) { } public boolean isAsexFlag ( ) { } protected void iveBeenCheated ( int othersID ) { } public Node makeNode ( Document doc ) { } @ Override public void move ( Location newPos ) { } public void playPD ( ComplexAgent other ) { } @ SuppressWarnings ( "javadoc" ) public void playPDonStep ( ComplexAgent adjacentAgent , int othersID ) { } protected void receiveBroadcast ( ) { } void receiveCheatingBroadcast ( BroadcastPacket commPacket ) { } void receiveFoodBroadcast ( BroadcastPacket commPacket ) { } public void setAsexFlag ( boolean asexFlag ) { } @ Override public void setColor ( Color c ) { } public void setCommInbox ( int commInbox ) { } public void setCommOutbox ( int commOutbox ) { } public void setConstants ( ComplexAgentParams agentData , ProductionParams prodData ) { } public void setMemoryBuffer ( int memoryBuffer ) { } public void step ( ) { } protected void onstepFreeTile ( org . cobweb . cobweb2 . core . Location destPos ) { org . cobweb . cobweb2 . core . Location breedPos = null ; if ( destPos . testFlag ( FLAG_FOOD ) ) { <START_BUG> if ( ( params . broadcastMode ) & ( canBroadcast ( ) ) ) { <END_BUG> broadcastFood ( destPos ) ; } if ( canEat ( destPos ) ) { eat ( destPos ) ; } if ( ( ( pregnant ) && ( ( energy ) >= ( params . breedEnergy ) ) ) && ( ( pregPeriod ) <= 0 ) ) { breedPos = getPosition ( ) ; energy -= params . initEnergy ; energy -= energyPenalty ( ) ; wasteCounterLoss -= params . initEnergy ; info . useOthers ( params . initEnergy ) ; } else { if ( ! ( pregnant ) ) tryAsexBreed ( ) ; } } for ( StepMutator m : ComplexAgent . stepMutators ) m . onStep ( this , destPos , getPosition ( ) ) ; move ( destPos ) ; if ( breedPos != null ) { if ( ( breedPartner ) == null ) { info . addDirectChild ( ) ; ComplexAgent child = ( ( ComplexAgent ) ( AgentSpawner . spawn ( ) ) ) ; child . init ( breedPos , this ) ; } else { info . addDirectChild ( ) ; breedPartner . info . addDirectChild ( ) ; ComplexAgent child = ( ( ComplexAgent ) ( AgentSpawner . spawn ( ) ) ) ; child . init ( breedPos , this , breedPartner ) ; info . addSexPreg ( ) ; } breedPartner = null ; pregnant = false ; } energy -= params . stepEnergy ; wasteCounterLoss -= params . stepEnergy ; info . useStepEnergy ( params . stepEnergy ) ; info . addStep ( ) ; } protected void onstepAgentBump ( ComplexAgent adjacentAgent ) { }

Fix:
if ( ( params . broadcastMode ) && ( canBroadcast ( ) ) ) {