. I will keep searching for bugs (Timeline Grits Teeth) , but for some reason there doesn't appear to be many
. . . . Oh, wait a minute! I forgot, that is a good thing
.
). He was building wonder. Why was he doing wonder if he only had built one unit and had one city. And the year was 2110BC. I think that he started building wonder too early? Or what do you think. I usually play without building many wonders(almost not at all) so maybe I am not the correct person to criticize this. By the way he was in "normal" continent and had plenty of places where he had possibility to spread.

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);
}
Personally I don't like using "while" statements in any of my programming as it's possible to have a situation where "while" is ALWAYS valid. Infinite possiblity loop bug anyone?
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: