summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-12-13 17:10:17 -0500
committergumi <git@gumi.ca>2018-12-13 17:10:17 -0500
commit7c1d56ae8932e80e152389c9666bc0a1c0ab5ed8 (patch)
treeea1c4f7413f6797730ec2604dd49ba803a9c5a19 /src/map
parentc1dd287b999c9cfcdc02ee01cede7619c173d656 (diff)
downloadtmwa-7c1d56ae8932e80e152389c9666bc0a1c0ab5ed8.tar.gz
tmwa-7c1d56ae8932e80e152389c9666bc0a1c0ab5ed8.tar.bz2
tmwa-7c1d56ae8932e80e152389c9666bc0a1c0ab5ed8.tar.xz
tmwa-7c1d56ae8932e80e152389c9666bc0a1c0ab5ed8.zip
add support for sending player HP for protocol >= 9
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.cpp51
1 files changed, 42 insertions, 9 deletions
diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index d287f4d..95e4ef2 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -670,9 +670,20 @@ void clif_set0078_main_1d8(dumb_ptr<map_session_data> sd, Buffer& buf, bool old_
fixed_1d8.hair_color = sd->status.hair_color;
fixed_1d8.clothes_color = sd->status.clothes_color;
fixed_1d8.head_dir = sd->head_dir;
- fixed_1d8.guild_id = 0;
- fixed_1d8.guild_emblem_id = 0;
- fixed_1d8.manner = sd->status.manner;
+
+ if (sd->client_version >= wrap<ClientVersion>(9))
+ {
+ fixed_1d8.hp = sd->status.hp;
+ fixed_1d8.part_of_max_hp = static_cast<short>(sd->status.max_hp & 0xffff);
+ fixed_1d8.manner_or_part_of_max_hp = static_cast<short>(sd->status.max_hp >> 16);
+ }
+ else
+ {
+ fixed_1d8.hp = 0; // guild id
+ fixed_1d8.part_of_max_hp = 0; // guild emblem id
+ fixed_1d8.manner_or_part_of_max_hp = sd->status.manner;
+ }
+
fixed_1d8.opt3 = sd->opt3;
fixed_1d8.karma = sd->status.karma;
fixed_1d8.sex = sd->status.sex;
@@ -725,9 +736,20 @@ void clif_set0078_alt_1d9(dumb_ptr<map_session_data> sd, Buffer& buf, bool old_c
fixed_1d8.hair_color = sd->status.hair_color;
fixed_1d8.clothes_color = sd->status.clothes_color;
fixed_1d8.head_dir = sd->head_dir;
- fixed_1d8.guild_id = 0;
- fixed_1d8.guild_emblem_id = 0;
- fixed_1d8.manner = sd->status.manner;
+
+ if (sd->client_version >= wrap<ClientVersion>(9))
+ {
+ fixed_1d8.hp = sd->status.hp;
+ fixed_1d8.part_of_max_hp = static_cast<short>(sd->status.max_hp & 0xffff);
+ fixed_1d8.manner_or_part_of_max_hp = static_cast<short>(sd->status.max_hp >> 16);
+ }
+ else
+ {
+ fixed_1d8.hp = 0; // guild id
+ fixed_1d8.part_of_max_hp = 0; // guild emblem id
+ fixed_1d8.manner_or_part_of_max_hp = sd->status.manner;
+ }
+
fixed_1d8.opt3 = sd->opt3;
fixed_1d8.karma = sd->status.karma;
fixed_1d8.sex = sd->status.sex;
@@ -781,9 +803,20 @@ void clif_set007b(dumb_ptr<map_session_data> sd, Buffer& buf, bool old_client)
fixed_1da.hair_color = sd->status.hair_color;
fixed_1da.clothes_color = sd->status.clothes_color;
fixed_1da.head_dir = sd->head_dir;
- fixed_1da.guild_id = 0;
- fixed_1da.guild_emblem_id = 0;
- fixed_1da.manner = sd->status.manner;
+
+ if (sd->client_version >= wrap<ClientVersion>(9))
+ {
+ fixed_1da.hp = sd->status.hp;
+ fixed_1da.part_of_max_hp = static_cast<short>(sd->status.max_hp & 0xffff);
+ fixed_1da.manner_or_part_of_max_hp = static_cast<short>(sd->status.max_hp >> 16);
+ }
+ else
+ {
+ fixed_1da.hp = 0; // guild id
+ fixed_1da.part_of_max_hp = 0; // guild emblem id
+ fixed_1da.manner_or_part_of_max_hp = sd->status.manner;
+ }
+
fixed_1da.opt3 = sd->opt3;
fixed_1da.karma = sd->status.karma;
fixed_1da.sex = sd->status.sex;