Example #1
0
/**
 * Delete everything associated with a NPC concerning the pattern
 * matching code
 *
 * this could be more efficent but.. how often do you do this?
 */
void npc_chat_finalize(struct npc_data* nd)
{
	struct npc_parse *npcParse = (struct npc_parse *) nd->chatdb;
	if (npcParse == NULL)
		return;

	while(npcParse->active)
		delete_pcreset(nd, npcParse->active->setid);

	while(npcParse->inactive)
		delete_pcreset(nd, npcParse->inactive->setid);

	// Additional cleaning up [Lance]
	aFree(npcParse);
}
Example #2
0
int buildin_deletepset (struct script_state *st)
{
	int setid = conv_num (st, & (st->stack->stack_data[st->start + 2]));
	struct npc_data *nd = (struct npc_data *) map_id2bl (st->oid);
	delete_pcreset (nd, setid);
	return 0;
}