From 4a65ddf6c61d72a52d18c9c18e1b405c49c591e9 Mon Sep 17 00:00:00 2001 From: gumi Date: Wed, 23 Aug 2017 14:50:33 -0400 Subject: remove buildin_closedialog, partly add it to buildin_closeclientdialog for backward-compatibility --- src/emap/init.c | 1 - src/emap/script_buildins.c | 18 ++++++++++-------- src/emap/script_buildins.h | 1 - 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/emap/init.c b/src/emap/init.c index 8cd7cd4..5621fb9 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -108,7 +108,6 @@ HPExport void plugin_init (void) addScriptCommand("movecam", "ii", moveCam); addScriptCommand("restorecam", "", restoreCam); addScriptCommand("npctalk3", "s", npcTalk3); - addScriptCommand("closedialog", "", closeDialog); addScriptCommand("closeclientdialog", "", closeClientDialog); addScriptCommand("shop", "s", shop); addScriptCommand("getitemlink", "v*", getItemLink); diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index 4c32a9a..d888b22 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -179,17 +179,19 @@ BUILDIN(npcTalk3) return true; } -BUILDIN(closeDialog) -{ - getSD(); - send_npccommand(sd, st->oid, 5); - return true; -} - BUILDIN(closeClientDialog) { getSD(); - send_npccommand(sd, st->oid, 14); + struct SessionExt *data = session_get_bysd(sd); + + if (data->clientVersion < 19) + { + send_npccommand(sd, st->oid, 5); + } + else + { + send_npccommand(sd, st->oid, 14); + } return true; } diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h index 91b02b3..81357b9 100644 --- a/src/emap/script_buildins.h +++ b/src/emap/script_buildins.h @@ -11,7 +11,6 @@ BUILDIN(setCam); BUILDIN(moveCam); BUILDIN(restoreCam); BUILDIN(npcTalk3); -BUILDIN(closeDialog); BUILDIN(closeClientDialog); BUILDIN(shop); BUILDIN(getItemLink); -- cgit v1.2.3-70-g09d2