diff options
author | Asheraf <Asheraf@users.noreply.github.com> | 2018-09-24 01:23:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-24 01:23:50 +0100 |
commit | 0bce86fa23eed2b558f4b2bff3b2b2e903a21375 (patch) | |
tree | 5fd0dd4d0b11f06000d4f6dab7ae206d783d466f | |
parent | fadc4ecbba8ac97af8be9f84c732e47c1629e30b (diff) | |
parent | c5ecaaaeb56408289904fdfc67dbbf9c1a5e94bd (diff) | |
download | hercules-0bce86fa23eed2b558f4b2bff3b2b2e903a21375.tar.gz hercules-0bce86fa23eed2b558f4b2bff3b2b2e903a21375.tar.bz2 hercules-0bce86fa23eed2b558f4b2bff3b2b2e903a21375.tar.xz hercules-0bce86fa23eed2b558f4b2bff3b2b2e903a21375.zip |
Merge pull request #2193 from Helianthella/mes
buildin_mes shorthand
-rw-r--r-- | src/map/script.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/map/script.c b/src/map/script.c index f1bb63aa3..b787d0138 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -5965,10 +5965,14 @@ static bool script_sprintf_helper(struct script_state *st, int start, struct Str static BUILDIN(mes) { struct map_session_data *sd = script->rid2sd(st); + if (sd == NULL) return true; - clif->scriptmes(sd, st->oid, script_getstr(st, 2)); + if (script_hasdata(st, 2)) + clif->scriptmes(sd, st->oid, script_getstr(st, 2)); + else + clif->scriptmes(sd, st->oid, ""); return true; } @@ -24960,8 +24964,8 @@ static void script_parse_builtin(void) BUILDIN_DEF(__setr,"rv?"), // NPC interaction - BUILDIN_DEF(mes,"s"), - BUILDIN_DEF(mesf,"s*"), + BUILDIN_DEF(mes, "?"), + BUILDIN_DEF(mesf, "s*"), BUILDIN_DEF(next,""), BUILDIN_DEF(close,""), BUILDIN_DEF(close2,""), |