|
CTP2 Bureau The Modding Knowledgebase |
Apolyton CTP2 section Apolyton CTP2 files Apolyton CTP2 forums Source Code Project SVN |
![]() |
|
Search the Wiki: |
ActionsPagesRecent Changes SearchCreate a new page:
|
AE Modding Wiki : Functions : KillCityNew SLIC function: KillCity(): Obviously kills population until the city is dead. Less obviously only works in messages, where the city is given from the context.
//EMODs
SFN_ERROR Slic_KillCity::Call(SlicArgList *args)
{
if (args->Count() > 0)
return SFN_ERROR_NUM_ARGS;
Unit city = g_slicEngine->GetContext()->GetCity(0);
if (!city.IsValid())
{
return SFN_ERROR_OK;
}
if(!city.GetData()->GetCityData()->CapturedThisTurn()) {
if(g_network.IsClient()) {
g_network.RequestResync(RESYNC_PROBABLE_CHEATER);
}
return SFN_ERROR_OK;
}
if(g_network.IsClient()) {
g_network.SendAction(new NetAction(NET_ACTION_FREE_SLAVES, city.m_id));
}
CityData *cd = city.GetData()->GetCityData();
sint32 PCount = cd->PopCount();
city.GetData()->GetCityData()->ChangePopulation(-PCount);
//city.GetData()->GetCityData()->Disband();
return SFN_ERROR_OK;
}
Page last modified on June 11, 2009, at 02:26 PM |
|
| AE Modding Wiki built with PmWiki Design: BureauBert Hosted by: Comball.net |