What can i do to make disband a unit add a pop when it is done in a city?
Please if it is not possible tell me. I need to get this answer.
Please if it is not possible tell me. I need to get this answer.
HandleEvent(DisbandUnit) 'addpopsinpedrunnscity' pre {
city_t tmpCity;
GetCityByLocation(unit[0].location, tmpCity);
if(CityIsValid(tmpCity)){
AddPops(tmpCity, 1);
}
}
BuildingRemovesAPop
HandleEvent(DisbandUnit) 'addpopsinpedrunnscity' pre {
city_t tmpCity;
message(1,'addpops2');
GetCityByLocation(unit[0].location, tmpCity);
if(CityIsValid(tmpCity)){
if ((unit[0].type == UnitDB(UNIT_SEA_ENGINEER))
||(unit[0].type == UnitDB(UNIT_SETTLER))
||(unit[0].type == UnitDB(UNIT_URBAN_PLANNER))) {
AddPops(tmpCity, 1);
message(1,'addpops1');
}
}
}
Messagebox 'addpops1' {
Show();
}
Messagebox 'addpops2' {
Show();
}
This is why I hate SLIC. This is why I love SLIC, and love to hate SLIC, and hate to love SLIC
HandleEvent(DisbandUnit) 'addpopsinpedrunnscity' pre {
city_t tmpCity;
message(1,'addpops2');
GetCityByLocation(unit[0].location, tmpCity);
if(CityIsValid(tmpCity)){
if ((unit[0].type == UnitDB(UNIT_SEA_ENGINEER))
||(unit[0].type == UnitDB(UNIT_SETTLER))
||(unit[0].type == UnitDB(UNIT_URBAN_PLANNER))) {
AddPops(tmpCity, 1);
message(1,'addpops1');
}
}
}
HandleEvent(DisbandArmyOrder) 'tryagain' pre {
int_t i;
unit_t tmpUnit;
for(i = 0; i < army[0].size; i = i + 1){
GetUnitFromArmy(army[0], i, tmpUnit);
unit[0] = tmpUnit;
if ((unit[0].type == UnitDB(UNIT_SEA_ENGINEER))
||(unit[0].type == UnitDB(UNIT_SETTLER))
||(unit[0].type == UnitDB(UNIT_URBAN_PLANNER))) {
GetCityByLocation(unit[0].location, tmpCity);
if(CityIsValid(tmpCity)){
AddPops(tmpCity, 1);
}
}
}
}
. I am almost feeling like a Slic Writter now
Comment