Im currently having my first experience programming slic, the goal is to remove that silly bug with internet wonder and computer centers still being build, when done it should work for all that type of wonders.
here is what it does for now:
HandleEvent(BeginTurn) 'WonderLookup' post {
int_t i;
int_t inetplayer;
city_t tmpCity;
inetPlayer = WonderOwner(WonderDB(WONDER_INTERNET));
if(inetPlayer != -1) {
//remove computer center from inetPlayer buildlists
for( i = 0 ; i < PlayerCityCount(inetPlayer); i = i + 1 ){
GetCityByIndex(inetPlayer, i, tmpCity);
KillBuildingFromBuildList(tmpCity, BuildingDB(IMPROVE_COMPUTER_CENTER));
}
}
}
as you can see it identifies the player that owns the wonder (if any) each turn and then procedes to remove all computer centers from the build lists of all cities the player own. it works for human players and AI alike.
i could really use a couple of tips on how to prevent computer center from appearing on the build lists at all.
but as it is now it should still prove usefull, i hate going trough all my build lists and manually removing buildings when i build such a wonder.
here is what it does for now:
HandleEvent(BeginTurn) 'WonderLookup' post {
int_t i;
int_t inetplayer;
city_t tmpCity;
inetPlayer = WonderOwner(WonderDB(WONDER_INTERNET));
if(inetPlayer != -1) {
//remove computer center from inetPlayer buildlists
for( i = 0 ; i < PlayerCityCount(inetPlayer); i = i + 1 ){
GetCityByIndex(inetPlayer, i, tmpCity);
KillBuildingFromBuildList(tmpCity, BuildingDB(IMPROVE_COMPUTER_CENTER));
}
}
}
as you can see it identifies the player that owns the wonder (if any) each turn and then procedes to remove all computer centers from the build lists of all cities the player own. it works for human players and AI alike.
i could really use a couple of tips on how to prevent computer center from appearing on the build lists at all.
but as it is now it should still prove usefull, i hate going trough all my build lists and manually removing buildings when i build such a wonder.
Comment