summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/clif.c8
-rw-r--r--src/map/map.c3
-rw-r--r--src/map/status.c12
4 files changed, 9 insertions, 16 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index f0d7fe97c..57662642a 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/06/15
+ * Fixed clif_send not sending packets to SELF when specifying AREA if the
+ source is not on the map yet. [Skotlex]
* Fixed and cleaned up script command 'equip' [Skotlex]
* Fixed 'autoequip' items. [Skotlex]
* Fixed Aspd not being updated in your status window after Agi/Dex
diff --git a/src/map/clif.c b/src/map/clif.c
index aad0a5ddc..f895a7579 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -276,7 +276,7 @@ int clif_send_sub(struct block_list *bl, va_list ap)
case AREA_WOSC:
{
struct map_session_data *ssd = (struct map_session_data *)src_bl;
- if ((ssd != 0) && (src_bl->type == BL_PC) && (sd->chatID != 0) && (sd->chatID == ssd->chatID))
+ if (ssd && (src_bl->type == BL_PC) && sd->chatID && (sd->chatID == ssd->chatID))
return 0;
}
break;
@@ -385,9 +385,11 @@ int clif_send (unsigned char *buf, int len, struct block_list *bl, int type) {
}
break;
case AREA:
- case AREA_WOS:
- case AREA_WOC:
case AREA_WOSC:
+ if (sd && bl->prev == NULL) //Otherwise source misses the packet.[Skotlex]
+ clif_send (buf, len, bl, SELF);
+ case AREA_WOC:
+ case AREA_WOS:
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;
diff --git a/src/map/map.c b/src/map/map.c
index b639e8f85..70b9d290e 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1744,8 +1744,7 @@ struct map_session_data * map_charid2sd(int id) {
*------------------------------------------
*/
struct map_session_data * map_nick2sd(char *nick) {
- int i, quantity=0, users;
- struct map_session_data *sd = NULL;
+ int i, users;
struct map_session_data *pl_sd = NULL, **pl_allsd;
if (nick == NULL)
diff --git a/src/map/status.c b/src/map/status.c
index a26986316..7fc090dd1 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -5162,13 +5162,8 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
break;
}
- if (sd)
- { //Why must it be ONLY for players? [Skotlex]
- if (bl->prev)
+ if (sd) //Only for players, client crashes if they receive this for a mob o.O [Skotlex]
clif_status_change(bl,StatusIconChangeTable[type],1);
- else
- clif_status_load(bl,StatusIconChangeTable[type],1);
- }
// Set option as needed.
opt_flag = 1;
@@ -5627,12 +5622,7 @@ int status_change_end( struct block_list* bl , int type,int tid )
}
if (sd)
- { //Why must it be ONLY for players? [Skotlex]
- if (bl->prev)
clif_status_change(bl,StatusIconChangeTable[type],0);
- else
- clif_status_load(bl,StatusIconChangeTable[type],0);
- }
opt_flag = 1;
switch(type){