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

SLIC-Reference : : AllUnitsCanBeExpelled  

Arguments: location Type: int

Returns true if all of the units at the location can be expelled

Returns false if there are no units there. Example:
// Declare variables
int_t i;
location_t my_loc;

// Initialise these variables

for(i = 0; i < 8; i = i + 1)

    GetNeighbor(city[0].location, i, my_loc);


        //do stuff
        return CONTINUE;


//if all of the enemy units 1 tile away from city[0], do stuff, then break the for loop and continue.


SFN_ERROR Slic_AllUnitsCanBeExpelled::Call(SlicArgList *args)
	if(args->Count() != 1)

	MapPoint pos;
	if(!args->GetPos(0, pos)) {

	Cell *cell = g_theWorld->GetCell(pos);
	if(cell->GetNumUnits() < 1) {
		m_result.m_int = 0;
		return SFN_ERROR_OK;
	} else {
		sint32 i;
		for(i = 0; i < cell->GetNumUnits(); i++) {
			if(!cell->AccessUnit(i).CanBeExpelled()) {
				m_result.m_int = 0;
				return SFN_ERROR_OK;
	m_result.m_int = 1;
	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*:
(A maximum of characters left)
Your name:*
Your website (URL):

*) Required fields

No user comments yet.

This site is currently maintained by: BureauBert (Webmaster)  Maquiladora (Manager)  Legal Notice: Legal Notice Statistics: 96259 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