Ok, my other project I want to do is add a flag for wonders (later buildings too) that will tell the program to create a wonderimprovement once a wonder is built. Yes, it is based on the visible wonders mod, but wouldn't it be nice to just add a flag ShowOnMap () and put the index number and the game will place it. I think so. So I'm looking at where to put the code first, and I think I'll relook the slic and then try to code it from there. I'm thinking the code might have to go in some of the code found in WonderTracker.cpp
OR in CityEvent.cpp
Code:
BOOL WonderTracker::HasWonderBeenBuilt(sint32 which) { return (m_builtWonders & ((uint64)1 << (uint64)which)) != 0; } void WonderTracker::AddBuilt(sint32 which) { m_builtWonders |= (uint64)1 << (uint64)which; if(g_network.IsHost()) { g_network.Enqueue(new NetInfo(NET_INFO_CODE_BUILT_WONDERS, (uint32)(m_builtWonders & 0xffffffff), (uint32)(m_builtWonders >> (uint64)32))); } } BOOL WonderTracker::GetCityWithWonder(sint32 which, Unit &city) { sint32 p; for(p = 0; p < k_MAX_PLAYERS; p++) { if(!g_player[p]) continue; sint32 c; for(c = g_player[p]->m_all_cities->Num() - 1; c >= 0; c--) { if(g_player[p]->m_all_cities->Access(c).GetData()->GetCityData()->GetBuiltWonders() & ((uint64)1 << which)) { city = g_player[p]->m_all_cities->Access(c); return TRUE; } } } return FALSE;
OR in CityEvent.cpp
Code:
STDEHANDLER(CityBuildWonderEvent) { Unit city; sint32 type; if(!args->GetCity(0, city)) return GEV_HD_Continue; if(!args->GetInt(0, type)) return GEV_HD_Continue; city.BuildWonder(type); return GEV_HD_Continue; }
Comment