Skip to content

Commit

Permalink
Merge pull request #2193 from Helianthella/mes
Browse files Browse the repository at this point in the history
buildin_mes shorthand
  • Loading branch information
Asheraf authored Sep 24, 2018
2 parents fadc4ec + c5ecaaa commit 0bce86f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/map/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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,""),
Expand Down

0 comments on commit 0bce86f

Please sign in to comment.