CTP2 Bureau
The Modding
Knowledgebase
Apolyton CTP2 section
Apolyton CTP2 files
Apolyton CTP2 forums
Source Code Project SVN

Actions

Pages

Recent Changes Search

Create a new page:

AE Modding Wiki : Functions : GetContinentSize

New SLIC function: GetContinentSize(location_t): Gets the size (number of tiles) of the landmass / ocean (!) the location belongs to.

//----------------------------------------------------------------------------
//
// Authored   : Martin Ghmann
//
// Name       : Slic_GetContinentSize
//
// Description: Get the size of position's continent.
//
// Parameters : SlicArg 0: location
//
// Globals    : g_theWorld
//
// Returns    : SFN_ERROR		: execution result
//
//----------------------------------------------------------------------------
SFN_ERROR Slic_GetContinentSize::Call(SlicArgList *args)
{
	if(args->Count() != 1)
		return SFN_ERROR_NUM_ARGS;

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

	if(g_theWorld->IsWater(pos)){
		m_result.m_int = g_theWorld->GetWaterContinentSize(g_theWorld->GetContinent(pos));
	}
	else{
		m_result.m_int = g_theWorld->GetLandContinentSize(g_theWorld->GetContinent(pos));
	}

	return SFN_ERROR_OK;
}
Page last modified on June 11, 2009, at 02:22 PM
  Administration
AE Modding Wiki built with PmWiki Design: BureauBert
Share this page:  VK Facebook Twitter LiveJournal OK MR Google+ LinkedIn tumblr Pinterest Blogger Digg Evernote