summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorGuilherme G. Menaldo <guilherme.menaldo@outlook.com>2018-06-15 11:49:32 -0300
committerGuilherme G. Menaldo <guilherme.menaldo@outlook.com>2018-07-12 15:15:09 -0300
commita3afe42f9025c1049c05da0b2b99aad7ca8a6907 (patch)
treea154eebdbcdf7b3282f3b2938bba262f85c2e5c7 /src/map/clif.c
parent8d028cbacdc4a424621c94a521c375baa234bdce (diff)
downloadhercules-a3afe42f9025c1049c05da0b2b99aad7ca8a6907.tar.gz
hercules-a3afe42f9025c1049c05da0b2b99aad7ca8a6907.tar.bz2
hercules-a3afe42f9025c1049c05da0b2b99aad7ca8a6907.tar.xz
hercules-a3afe42f9025c1049c05da0b2b99aad7ca8a6907.zip
Fixed clearunit packet not being sent to clients going out of the view range when monster dies
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index adc7562e1..9d8ca844b 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -434,6 +434,7 @@ static bool clif_send(const void *buf, int len, struct block_list *bl, enum send
struct battleground_data *bgd = NULL;
int x0 = 0, x1 = 0, y0 = 0, y1 = 0, fd;
struct s_mapiterator* iter;
+ int area_size;
if( type != ALL_CLIENT )
nullpo_ret(bl);
@@ -472,13 +473,18 @@ static bool clif_send(const void *buf, int len, struct block_list *bl, enum send
case AREA:
case AREA_WOSC:
+ case AREA_DEAD:
if (sd && bl->prev == NULL) //Otherwise source misses the packet.[Skotlex]
clif->send (buf, len, bl, SELF);
/* Fall through */
case AREA_WOC:
case AREA_WOS:
+ if (type == AREA_DEAD)
+ area_size = DEAD_AREA_SIZE;
+ else
+ area_size = AREA_SIZE;
nullpo_retr(true, bl);
- map->foreachinarea(clif->send_sub, bl->m, bl->x-AREA_SIZE, bl->y-AREA_SIZE, bl->x+AREA_SIZE, bl->y+AREA_SIZE,
+ map->foreachinarea(clif->send_sub, bl->m, bl->x - area_size, bl->y - area_size, bl->x + area_size, bl->y + area_size,
BL_PC, buf, len, bl, type);
break;
case AREA_CHAT_WOC:
@@ -909,7 +915,12 @@ static void clif_clearunit_area(struct block_list *bl, clr_type type)
WBUFL(buf,2) = bl->id;
WBUFB(buf,6) = type;
- clif->send(buf, packet_len(0x80), bl, type == CLR_DEAD ? AREA : AREA_WOS);
+ /**
+ * When monster dies, there's a delay before the packet is sent,
+ * so we send it to a bigger area to avoid clients at the edge
+ * walking out of the area and missing it [KirieZ]
+ */
+ clif->send(buf, packet_len(0x80), bl, type == CLR_DEAD ? AREA_DEAD : AREA_WOS);
if (clif->isdisguised(bl)) {
WBUFL(buf,2) = -bl->id;