コード例 #1
0
ファイル: textparse.cpp プロジェクト: Misiaczek/amxmodx
cell destroyParser(cell *handle)
{
	ParseInfo *p = TextParsersHandles.lookup(*handle);

	if (!p)
	{
		return 0;
	}

	if (TextParsersHandles.destroy(*handle))
	{
		*handle = 0;
		return 1;
	}

	return 0;
}
コード例 #2
0
//native TrieSnapshotDestroy(&Snapshot:handle)
static cell AMX_NATIVE_CALL TrieSnapshotDestroy(AMX *amx, cell *params)
{
	cell *ptr = get_amxaddr(amx, params[1]);

	TrieSnapshot *t = TrieSnapshotHandles.lookup(*ptr);

	if (!t)
	{
		return 0;
	}

	if (TrieSnapshotHandles.destroy(*ptr))
	{
		*ptr = 0;
		return 1;
	}

	return 0;
}
コード例 #3
0
ファイル: datastructs.cpp プロジェクト: Javivi/amxmodx
// native ArrayDestroy(&Array:which);
static cell AMX_NATIVE_CALL ArrayDestroy(AMX* amx, cell* params)
{
	cell *handle = get_amxaddr(amx, params[1]);

	CellArray* vec = ArrayHandles.lookup(*handle);

	if (!vec)
	{
		return 0;
	}

	if (ArrayHandles.destroy(*handle))
	{
		*handle = 0;
		return 1;
	}

	return 1;
}
コード例 #4
0
ファイル: gameconfigs.cpp プロジェクト: Javivi/amxmodx
// native CloseGameConfigFile(&GameConfig:handle);
static cell AMX_NATIVE_CALL CloseGameConfigFile(AMX *amx, cell *params)
{
	cell *address = get_amxaddr(amx, params[1]);

	GameConfigNative *handle = GameConfigHandle.lookup(*address);

	if (!handle)
	{
		return 0;
	}

	if (GameConfigHandle.destroy(*address))
	{
		*address = 0;
		return 1;
	}

	return 0;
}