summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <mekolat@users.noreply.github.com>2017-08-23 14:50:33 -0400
committergumi <mekolat@users.noreply.github.com>2017-08-23 15:15:44 -0400
commit4a65ddf6c61d72a52d18c9c18e1b405c49c591e9 (patch)
tree1be4e826661148ebb85c3052aeeed62d0ad96528
parentdee2b1a29dc3af07bb434ab986aa552e8be5e26c (diff)
downloadplugin-4a65ddf6c61d72a52d18c9c18e1b405c49c591e9.tar.gz
plugin-4a65ddf6c61d72a52d18c9c18e1b405c49c591e9.tar.bz2
plugin-4a65ddf6c61d72a52d18c9c18e1b405c49c591e9.tar.xz
plugin-4a65ddf6c61d72a52d18c9c18e1b405c49c591e9.zip
remove buildin_closedialog, partly add it to buildin_closeclientdialog for backward-compatibilityclosedialog
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/script_buildins.c18
-rw-r--r--src/emap/script_buildins.h1
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);