From e061189cdeb39b3efb0fd3a9e6f299379671fb2f Mon Sep 17 00:00:00 2001 From: Lance Date: Sat, 24 Jun 2006 02:41:32 +0000 Subject: * [Optimized]: - Setting of variables with defined scope in some frequently executed script events. * [Added]: - Missing script_require_trigger flags for some power hungry events. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7325 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mob.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/map/mob.c') diff --git a/src/map/mob.c b/src/map/mob.c index abf92a691..2b1673687 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2992,14 +2992,18 @@ int mob_clone_delete(int class_) int mob_script_callback(struct mob_data *md, struct block_list *target, short action_type) { - // I will not add any protection here since I assume everything is checked before coming here. + // DEBUG: Uncomment these if errors occur. --- + // nullpo_retr(md, 0); + // nullpo_retr(md->nd, 0); + // ------------------------------------------- if(md->callback_flag&action_type){ - setd_sub(NULL, NULL, ".ai_action", 0, (void *)(int)action_type, &md->nd->u.scr.script->script_vars); + int regkey = add_str(".ai_action"); + linkdb_replace(&md->nd->u.scr.script->script_vars,(void *)regkey, (void *)(int)action_type); if(target){ - setd_sub(NULL, NULL, ".ai_action", 1, (void *)(int)target->type, &md->nd->u.scr.script->script_vars); - setd_sub(NULL, NULL, ".ai_action", 2, (void *)target->id, &md->nd->u.scr.script->script_vars); + linkdb_replace(&md->nd->u.scr.script->script_vars,(void *)(regkey+(1<<24)), (void *)(int)target->type); + linkdb_replace(&md->nd->u.scr.script->script_vars,(void *)(regkey+(2<<24)), (void *)target->id); } - setd_sub(NULL, NULL, ".ai_action", 3, (void *)md->bl.id, &md->nd->u.scr.script->script_vars); + linkdb_replace(&md->nd->u.scr.script->script_vars,(void *)(regkey+(3<<24)), (void *)md->bl.id); run_script(md->nd->u.scr.script, 0, 0, md->nd->bl.id); return 1; } -- cgit v1.2.3-60-g2f50