E, don't you have ideas that are simpler to code first than this?
-Martin
-Martin
void CityData::AddWonder(sint32 type) { const WonderRecord* wrec = wonderutil_Get(type); //added by E MapPoint cityPos = m_home_city.RetPos(); //EMOD MapPoint Pos; m_builtWonders |= (uint64(1) << type); //EMOD Visible Wonders should go here like the radius for AddImprovement 3-27-2006 if (wrec->GetNumShowOnMap() > 0){ CityInfluenceIterator it(cityPos, m_sizeIndex); for(it.Start(); !it.End(); it.Next()) { Cell *cell = g_theWorld->GetCell(it.Pos()); //sint32 ring = GetRing(it.Pos()); sint32 s; for(s = 0; s < wrec->GetNumShowOnMap(); s++) { const TerrainImprovementRecord *rec = g_theTerrainImprovementDB->Get(s); //if terrainutil_CanPlayerBuildAt(const TerrainImprovementRecord *rec, sint32 pl, const MapPoint &pos) if(terrainutil_CanPlayerBuildAt(rec, m_owner, Pos)) { //CreateImprovement(sint32 dbIndex, MapPoint &point, sint32 extraData) //g_player[m_owner]->CreateImprovement(wrec->GetShowOnMapIndex(s), Pos, 0); } } } }
//g_player[m_owner]->CreateImprovement(rec->GetIndex(), Pos, 0);
g_gevManager->AddEvent(GEV_INSERT_Tail, GEV_CreateImprovement, GEA_Player, m_owner, GEA_MapPoint, Pos, GEA_Int, s, //type, GEA_Int, 0, GEA_End);
//EMOD Visible Wonders should go here like the radius for AddImprovement 3-27-2006 if (wrec->GetNumShowOnMap() > 0){ CityInfluenceIterator it(cityPos, m_sizeIndex); for(it.Start(); !it.End(); it.Next()) { Cell *cell = g_theWorld->GetCell(it.Pos()); //sint32 ring = GetRing(it.Pos()); sint32 s; for(s = 0; s < wrec->GetNumShowOnMap(); s++) { const TerrainImprovementRecord *rec = g_theTerrainImprovementDB->Get(s); //if terrainutil_CanPlayerBuildAt(const TerrainImprovementRecord *rec, sint32 pl, const MapPoint &pos) if(terrainutil_CanPlayerBuildAt(rec, m_owner, Pos)) { //CreateImprovement(sint32 dbIndex, MapPoint &point, sint32 extraData) g_player[m_owner]->CreateImprovement(wrec->GetShowOnMapIndex(s), Pos, 0); } } } }
void CityData::AddWonder(sint32 type) //not used? cityevent did not call it now it does 3-26-2006 EMOD { const WonderRecord* wrec = wonderutil_Get(type); //added by E MapPoint cityPos(m_home_city.RetPos()); MapPoint Pos; m_builtWonders |= (uint64(1) << type); //EMOD wonders add borders too sint32 intRad; sint32 sqRad; //EMOD increases city borders if (wrec->GetIntBorderRadius(intRad) && wrec->GetSquaredBorderRadius(sqRad)) { GenerateBorders(cityPos, m_owner, intRad, sqRad); } //end Emod //EMOD Visible Wonders should go here like the radius for AddImprovement 3-27-2006 CityInfluenceIterator it(cityPos, m_sizeIndex); for(it.Start(); !it.End(); it.Next()) { Cell *cell = g_theWorld->GetCell(it.Pos()); if(cityPos == it.Pos()) continue; sint32 s; for(s = 0; s < wrec->GetNumShowOnMap(); s++) { const TerrainImprovementRecord *rec = g_theTerrainImprovementDB->Get(s); if(terrainutil_CanPlayerBuildAt(rec, m_owner, it.Pos())) { g_player[m_owner]->CreateImprovement(rec->GetIndex(), it.Pos(), 0); break; } } }
CityInfluenceIterator it(cityPos, 1); //m_sizeIndex for(it.Start(); !it.End(); it.Next()) { Cell *cell = g_theWorld->GetCell(it.Pos()); if(cityPos == it.Pos()) continue; sint32 s; for(s = 0; s < wrec->GetNumShowOnMap(); s++) { const TerrainImprovementRecord *rec = g_theTerrainImprovementDB->Get(s); if(terrainutil_CanPlayerSpecialBuildAt(rec, m_owner, it.Pos())) { g_player[m_owner]->CreateSpecialImprovement(wrec->GetShowOnMapIndex(s), it.Pos(), 0); } } }
//EMOD Visible Wonders 4-1-2006 CityInfluenceIterator it(cityPos, m_sizeIndex); for(it.Start(); !it.End(); it.Next()) { Cell *cell = g_theWorld->GetCell(it.Pos()); if(cityPos == it.Pos()) continue; sint32 s; bool SpotFound = true; for(s = 0; s < wrec->GetNumShowOnMap(); s++) { const TerrainImprovementRecord *rec = g_theTerrainImprovementDB->Get(s); if(!terrainutil_CanPlayerSpecialBuildAt(rec, m_owner, it.Pos())) { SpotFound = false; break; } if(!SpotFound){ continue; } else { g_player[m_owner]->CreateSpecialImprovement(wrec->GetShowOnMapIndex(s), it.Pos(), 0); return; } } }
Comment