![Smile](https://apolyton.net/core/images/smilies/smile.gif)
I will keep searching for bugs (Timeline Grits Teeth) , but for some reason there doesn't appear to be many
![Confused](https://apolyton.net/core/images/smilies/confused.gif)
![Big Grin](https://apolyton.net/core/images/smilies/biggrin.gif)
boolean established = false; //lets loop throug all cities //(there might be a city with no land coordinate next to it) for ( int i = 0; i < player.getCityCount(); i++ ) { if ( !established ) //! = not { city_t tmpCity = getCity( player, getCity( j ) ); //lets loop through all coordinates next to city for ( int j = 0; j < 8; j++ ) { if ( !established ) //! = not { Coordinate c = getCoordinateNextToCity( tmpCity, j ); if ( c.hasUnits() == false && c.UnitCanBeHere( noble ) ) { //create noble & establish embassy here established = true; } } } } }
if(DIP_hasemb[(DIP_NumOfPlayers * civ) + civ2] == 0 && DIP_hademb[(DIP_NumOfPlayers * civ) + civ2] == 1 && !(AtWarWith(civ, civ2))) { DIP_EstablishEmbassyFunc(civ2); }
1: if(CityIsValid(tmpcity)) { 2: GetRandomNeighbor(tmpcity.location, tmploc); 3: if(GetUnitsAtLocation(tmploc) == 0) { 4: if(TerrainType(tmploc) < 10 || TerrainType(tmploc) > 17) { 5: if(TerrainType(tmploc) != 23 && TerrainType(tmploc) != 24) { 6: CreateUnit(civ, UnitDB(UNIT_NOBLE), tmploc, 0, tmpunit); 7: Event: EstablishEmbassyUnit(tmpunit, tmpcity); 8: Event: DisbandUnit(tmpunit); 9: DIP_hasemb[(DIP_NumOfPlayers * civ) + civ2] = 1; 10: DIP_hademb[(DIP_NumOfPlayers * civ) + civ2] = 0; 11: }
GetRandomNeighbor(tmpcity.location, tmploc); while ( GetUnitsAtLocation(tmploc) > 0 ) { GetRandomNeighbor(tmpcity.location, tmploc); } ...code comes here only when GetUnitsAtLocation(tmploc) returns 0 (no units there)
Leave a comment: