summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-24 02:41:32 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-24 02:41:32 +0000
commite061189cdeb39b3efb0fd3a9e6f299379671fb2f (patch)
treea00b8b11e068c2beec5112f17a167cd5652d919d /src/map/mob.c
parent2d740c0b724383ea09540509d7069d02b74db096 (diff)
downloadhercules-e061189cdeb39b3efb0fd3a9e6f299379671fb2f.tar.gz
hercules-e061189cdeb39b3efb0fd3a9e6f299379671fb2f.tar.bz2
hercules-e061189cdeb39b3efb0fd3a9e6f299379671fb2f.tar.xz
hercules-e061189cdeb39b3efb0fd3a9e6f299379671fb2f.zip
* [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
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c14
1 files changed, 9 insertions, 5 deletions
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;
}