summaryrefslogtreecommitdiff
path: root/src/emap
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-04-04 22:33:05 +0300
committerAndrei Karas <akaras@inbox.ru>2017-04-04 22:34:00 +0300
commitec28958d868afdb3b3e421200c630d15b3526096 (patch)
treed40202cfd941c1aa89277a1124785a1e18e15587 /src/emap
parent8fe364817c3e670f1d36d9fa09a8be5a2668a150 (diff)
downloadplugin-ec28958d868afdb3b3e421200c630d15b3526096.tar.gz
plugin-ec28958d868afdb3b3e421200c630d15b3526096.tar.bz2
plugin-ec28958d868afdb3b3e421200c630d15b3526096.tar.xz
plugin-ec28958d868afdb3b3e421200c630d15b3526096.zip
Send current player language in send_pc_info.
Send send_pc_info if language was changed. Also change plugin version to 17.
Diffstat (limited to 'src/emap')
-rw-r--r--src/emap/pc.c1
-rw-r--r--src/emap/send.c21
2 files changed, 14 insertions, 8 deletions
diff --git a/src/emap/pc.c b/src/emap/pc.c
index 92e6fca..c6fdb02 100644
--- a/src/emap/pc.c
+++ b/src/emap/pc.c
@@ -63,6 +63,7 @@ int epc_setregistry_pre(TBL_PC **sdPtr,
if (!data)
return 0;
data->language = *val;
+ send_pc_info(&sd->bl, &sd->bl, AREA);
}
else if (*reg == mountScriptId)
{
diff --git a/src/emap/send.c b/src/emap/send.c
index a570ec0..616713f 100644
--- a/src/emap/send.c
+++ b/src/emap/send.c
@@ -185,28 +185,33 @@ void send_pc_info(struct block_list* bl1,
if (!bl1 || bl1->type != BL_PC)
return;
- char buf[14];
struct map_session_data *sd = (struct map_session_data *)bl1;
struct SessionExt *data = session_get_bysd(sd);
if (!data)
return;
struct map_session_data *tsd = (struct map_session_data *)bl2;
- if (tsd)
- {
- struct SessionExt *tdata = session_get_bysd(tsd);
- if (!tdata || (bl1 != bl2 && tdata->clientVersion < 4))
- return;
- }
+ if (!tsd)
+ return;
+ struct SessionExt *tdata = session_get_bysd(tsd);
+ if (!tdata || (bl1 != bl2 && tdata->clientVersion < 4))
+ return;
+ int len = 14;
+ if (tdata->clientVersion >= 21)
+ len = 16;
+ char buf[len];
WBUFW (buf, 0) = 0xb0a;
- WBUFW (buf, 2) = 14; // len
+ WBUFW (buf, 2) = len;
WBUFL (buf, 4) = sd->bl.id;
if (pc_has_permission(sd, permission_send_gm_flag))
WBUFL (buf, 8) = sd->group_id;
else
WBUFL (buf, 8) = 0;
WBUFW (buf, 12) = data->mount;
+ if (tdata->clientVersion >= 21)
+ WBUFW (buf, 14) = data->language;
+
clif->send(&buf, sizeof(buf), bl2, target);
}