diff options
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/map/script.c b/src/map/script.c index 7184707..371d17b 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -42,6 +42,11 @@ return true; \ struct SessionExt *data = session_get(sd->fd) +#define getSD() \ + TBL_PC *sd = script->rid2sd(st); \ + if (!sd) \ + return 1 + BUILDIN(l) { // for now not translate and not use format parameters @@ -69,10 +74,7 @@ BUILDIN(setLang) BUILDIN(setCamNpc) { - TBL_PC *sd = script->rid2sd(st); - if (!sd) - return 1; - + getSD(); struct npc_data *nd = NULL; int x = 0; @@ -105,10 +107,7 @@ BUILDIN(setCamNpc) BUILDIN(restoreCam) { - TBL_PC *sd = script->rid2sd(st); - if (!sd) - return 1; - + getSD(); send_npccommand(sd, st->oid, 3); return 0; } |