diff options
author | AnnieRuru <jeankof@ymail.com> | 2015-12-14 14:29:22 +0800 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-12-20 16:18:55 +0100 |
commit | 3f1deb08626c8ca9043cc8250146560588753c0a (patch) | |
tree | 2277948939dc01cba5d2b85d736f496001d6fc22 /src/map/script.c | |
parent | b07bcf944bdd934addefe98b532ee03adaded61e (diff) | |
download | hercules-3f1deb08626c8ca9043cc8250146560588753c0a.tar.gz hercules-3f1deb08626c8ca9043cc8250146560588753c0a.tar.bz2 hercules-3f1deb08626c8ca9043cc8250146560588753c0a.tar.xz hercules-3f1deb08626c8ca9043cc8250146560588753c0a.zip |
Change map->charid2sd into script->charid2sd
- *charid2rid is exempted to check the condition
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/map/script.c b/src/map/script.c index 44566a971..cc4de43ac 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -5958,8 +5958,8 @@ BUILDIN(warpchar) { y=script_getnum(st,4); a=script_getnum(st,5); - sd = map->charid2sd(a); - if( sd == NULL ) + sd = script->charid2sd(st, a); + if (sd == NULL) return true; if(strcmp(str, "Random") == 0) @@ -7367,9 +7367,9 @@ BUILDIN(getnameditem) { if( script_isstringtype(st, 3) ) //Char Name tsd=map->nick2sd(script_getstr(st, 3)); else //Char Id was given - tsd=map->charid2sd(script_getnum(st, 3)); + tsd = script->charid2sd(st, script_getnum(st, 3)); - if( tsd == NULL ) { + if (tsd == NULL) { //Failed script_pushint(st,0); return true; @@ -10048,16 +10048,16 @@ BUILDIN(clone) { m = map->mapname2mapid(mapname); if (m < 0) return true; - sd = map->charid2sd(char_id); + sd = script->charid2sd(st, char_id); if (master_id) { msd = map->charid2sd(master_id); - if (msd) + if (msd != NULL) master_id = msd->bl.id; else master_id = 0; } - if (sd) //Return ID of newly crafted clone. + if (sd != NULL) //Return ID of newly crafted clone. script_pushint(st,mob->clone_spawn(sd, m, x, y, event, master_id, mode, flag, 1000*duration)); else //Failed to create clone. script_pushint(st,0); @@ -12645,8 +12645,8 @@ BUILDIN(warppartner) TBL_PC *sd=script->rid2sd(st); TBL_PC *p_sd=NULL; - if ( sd==NULL || !pc->ismarried(sd) - || (p_sd=map->charid2sd(sd->status.partner_id)) == NULL) { + if (sd == NULL || !pc->ismarried(sd) + || (p_sd = script->charid2sd(st, sd->status.partner_id)) == NULL) { script_pushint(st,0); return true; } @@ -13724,10 +13724,9 @@ BUILDIN(getmercinfo) if (script_hasdata(st,3)) { int char_id = script_getnum(st,3); - if ((sd = map->charid2sd(char_id)) == NULL) { - ShowError("buildin_getmercinfo: No such character (char_id=%d).\n", char_id); + if ((sd = script->charid2sd(st, char_id)) == NULL) { script_pushnil(st); - return false; + return true; } } else { if ((sd = script->rid2sd(st)) == NULL) |