CTP2 Bureau
The Modding
Knowledgebase
Apolyton CTP2 forums
Apolyton CTP2 archives
Source Code Project SVN

Actions

Pages

Recent Changes Search

Create a new page:

AE Modding Wiki : Functions : UnitMovementLeft

New SLIC-function: UnitMovementLeft(unit)

Returns remaining movement, same as terrain.txt. 100 = 1 move, 33 = a single road move etc.

//----------------------------------------------------------------------------
//
// Authored   : Maq
//
// Name       : Slic_UnitMovementLeft
//
// Description: Function to figure out how much movement is left for 
//              a unit.
//
// Parameters : SlicArg 0: unit
//
// Globals    : -
//
// Returns    : SFN_ERROR		: execution result
//
//----------------------------------------------------------------------------
SFN_ERROR Slic_UnitMovementLeft::Call(SlicArgList *args)
{
	if(args->Count() != 1)
		return SFN_ERROR_NUM_ARGS;

	Unit unit;
	if(!args->GetUnit(0, unit)) {
		return SFN_ERROR_TYPE_BUILTIN;
	}

	m_result.m_int = unit.GetMovementPoints();

	return SFN_ERROR_OK;
}
Page last modified on July 17, 2009, at 06:18 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