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 : RemoveGood

//----------------------------------------------------------------------------
//
// Authored   : MrBaggins
//
// Name       : Slic_RemoveGood
//
// Description: New complimentary function to PlantGood
//
// Parameters : SlicArg 0: location
//
// Globals    : g_theWorld	: World gamestate functionality
//				g_tiledMap  : UI update functionality
//
// Returns    : SFN_ERROR		: execution result
//
//----------------------------------------------------------------------------
SFN_ERROR Slic_RemoveGood::Call(SlicArgList *args)
{
	if(args->Count() != 1)
		return SFN_ERROR_NUM_ARGS;

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

	g_theWorld->SetGood(pos.x, pos.y, 0);
	// plants a good of subtype 0 AKA no good, at location x,y.
	g_tiledMap->PostProcessTile(pos, g_theWorld->GetTileInfo(pos));
	g_tiledMap->TileChanged(pos);
	g_tiledMap->RedrawTile(&pos);

	return SFN_ERROR_OK;
}
Page last modified on June 10, 2009, at 09:41 AM
  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