SLIC-Reference : AddPops
CTP2 Bureau
The Modding
Knowledgebase
Apolyton CTP2 forums
Apolyton CTP2 archives
Source Code Project SVN

SLIC-Reference : : AddPops  

Arguments: city, count Type: int

Increase the population of the given city by count

Example:
AddPops(city[0], 5);

//increases city[0]'s size by 5

tested   working  

Source:

SFN_ERROR Slic_AddPops::Call(SlicArgList *args)
{
	if (args->Count() != 2)
		return SFN_ERROR_NUM_ARGS;
	Unit city;
	BOOL res;

	res = args->GetCity(0, city);
	if(!res) {
		return SFN_ERROR_TYPE_ARGS;
	}

	sint32 count;
	if(!args->GetInt(1, count))
		return SFN_ERROR_TYPE_ARGS;

	MapPoint pos; 
	city.GetPos(pos);
	
	sint32 i;
	if(count > 0) {
		for (i=0; iAddEvent(GEV_INSERT_Tail, GEV_MakePop,
								   GEA_City, city.m_id,
								   GEA_End);
			
		}
	} else {
		for(i = count; i < 0; i++) {
		}
	}

	
	sint32 delta_martial_law;
	CityData *cd = city.GetData()->GetCityData();
	cd->GetHappy()->CalcHappiness(*cd, false, delta_martial_law, true);

	return SFN_ERROR_OK;
}

Information last updated by BureauBert on 23.11.2010

User Comments:

Using this form you may add your own observations concerning the above item, e.g. additional hints for usage, limitations, oddities etc. Please note this is not the place for asking questions or carrying out discussions about modding - please refer to the Apolyton CTP2 Modification Forum on that purpose.

Subject / Title*:
Text:*
(A maximum of characters left)
Your name:*
Your website (URL):

*) Required fields

Unkown Tag: NameUnkown Tag: Name

  Administration
This site is currently maintained by: BureauBert (Webmaster)  Maquiladora (Manager)  Legal Notice: Legal Notice Statistics: 123597 unique users since 02.05.2004 (» Site Statistics) Hosted by: WebhostOne
Share this page:  VK Facebook Twitter LiveJournal OK MR Google+ LinkedIn tumblr Pinterest Blogger Digg Evernote