summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-11-04 21:16:03 +0100
committerGitHub <noreply@github.com>2017-11-04 21:16:03 +0100
commit41f3237e4537d7105fb47d56b455d31cf33c155c (patch)
treebe03ffc4b7ad3e54da03cb8f9918516a6c3fc6d6 /src/map/clif.c
parent94a8ddedf7307aab1452fbd0da80d3b8b254eaf1 (diff)
parent3e03556e510feb34b6f590574cd3025ef54739a6 (diff)
downloadhercules-41f3237e4537d7105fb47d56b455d31cf33c155c.tar.gz
hercules-41f3237e4537d7105fb47d56b455d31cf33c155c.tar.bz2
hercules-41f3237e4537d7105fb47d56b455d31cf33c155c.tar.xz
hercules-41f3237e4537d7105fb47d56b455d31cf33c155c.zip
Merge pull request #1889 from 4144/fixpackets
Fix boss flag and add 2017-10-25 client packets
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 088c92ea8..1b7d94ca9 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1067,14 +1067,17 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
#endif
#if PACKETVER >= 20120221
if (battle_config.show_monster_hp_bar && bl->type == BL_MOB && status_get_hp(bl) < status_get_max_hp(bl)) {
- const struct mob_data *md = BL_UCCAST(BL_MOB, bl);
p.maxHP = status_get_max_hp(bl);
p.HP = status_get_hp(bl);
- p.isBoss = (md->spawn != NULL && md->spawn->state.boss) ? 1 : 0;
} else {
p.maxHP = -1;
p.HP = -1;
- p.isBoss = 0;
+ }
+ if (bl->type == BL_MOB) {
+ const struct mob_data *md = BL_UCCAST(BL_MOB, bl);
+ p.isBoss = (md->spawn != NULL) ? md->spawn->state.boss : BTYPE_NONE;
+ } else {
+ p.isBoss = BTYPE_NONE;
}
#endif
#if PACKETVER >= 20150513
@@ -1216,14 +1219,17 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
#endif
#if PACKETVER >= 20120221
if (battle_config.show_monster_hp_bar && bl->type == BL_MOB && status_get_hp(bl) < status_get_max_hp(bl)) {
- const struct mob_data *md = BL_UCCAST(BL_MOB, bl);
p.maxHP = status_get_max_hp(bl);
p.HP = status_get_hp(bl);
- p.isBoss = (md->spawn != NULL && md->spawn->state.boss) ? 1 : 0;
} else {
p.maxHP = -1;
p.HP = -1;
- p.isBoss = 0;
+ }
+ if (bl->type == BL_MOB) {
+ const struct mob_data *md = BL_UCCAST(BL_MOB, bl);
+ p.isBoss = (md->spawn != NULL) ? md->spawn->state.boss : BTYPE_NONE;
+ } else {
+ p.isBoss = BTYPE_NONE;
}
#endif
#if PACKETVER >= 20150513
@@ -1315,14 +1321,17 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
#endif
#if PACKETVER >= 20120221
if (battle_config.show_monster_hp_bar && bl->type == BL_MOB && status_get_hp(bl) < status_get_max_hp(bl)) {
- const struct mob_data *md = BL_UCCAST(BL_MOB, bl);
p.maxHP = status_get_max_hp(bl);
p.HP = status_get_hp(bl);
- p.isBoss = (md->spawn != NULL && md->spawn->state.boss) ? 1 : 0;
} else {
p.maxHP = -1;
p.HP = -1;
- p.isBoss = 0;
+ }
+ if (bl->type == BL_MOB) {
+ const struct mob_data *md = BL_UCCAST(BL_MOB, bl);
+ p.isBoss = (md->spawn != NULL) ? md->spawn->state.boss : BTYPE_NONE;
+ } else {
+ p.isBoss = BTYPE_NONE;
}
#endif
#if PACKETVER >= 20150513