summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-08-20 18:55:56 +0200
committerHaru <haru@dotalux.com>2013-08-20 18:59:59 +0200
commit4a9c55a77daa478b9f994d5a1b06619104b82982 (patch)
tree144817a938ca4e3756e0bbdbaf327cc7632a5631 /src/map/clif.c
parentac131bf1baa9a8f9a87176beadf1ce4ebd8abb01 (diff)
downloadhercules-4a9c55a77daa478b9f994d5a1b06619104b82982.tar.gz
hercules-4a9c55a77daa478b9f994d5a1b06619104b82982.tar.bz2
hercules-4a9c55a77daa478b9f994d5a1b06619104b82982.tar.xz
hercules-4a9c55a77daa478b9f994d5a1b06619104b82982.zip
Fixed a mapserver crash when using instanced maps with custom names
- Fixes bugreport:7658 (thanks to purityz) http://hercules.ws/board/tracker/issue-7658-instance-mapserver-crashing/ - The crash was caused by a pointer becoming invalid when reallocating map[] (i.e. when adding maps), since 20bdc01f Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 0d78ca488..2275f7bfe 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1633,7 +1633,7 @@ void clif_changemap(struct map_session_data *sd, short m, int x, int y) {
WFIFOHEAD(fd,packet_len(0x91));
WFIFOW(fd,0) = 0x91;
- mapindex_getmapname_ext(map[m].cName ? map[m].cName : map[m].name, (char*)WFIFOP(fd,2));
+ mapindex_getmapname_ext(map[m].custom_name ? map[map[m].instance_src_map].name : map[m].name, (char*)WFIFOP(fd,2));
WFIFOW(fd,18) = x;
WFIFOW(fd,20) = y;
WFIFOSET(fd,packet_len(0x91));
@@ -4568,7 +4568,7 @@ void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_targe
WBUFW(buf,2) = x;
WBUFW(buf,4) = y;
WBUFW(buf,6) = type;
- mapindex_getmapname_ext(map[m].cName ? map[m].cName : map[m].name,(char*)WBUFP(buf,8));
+ mapindex_getmapname_ext(map[m].custom_name ? map[map[m].instance_src_map].name : map[m].name,(char*)WBUFP(buf,8));
if( fd ) {
WFIFOHEAD(fd,packet_len(0x192));
@@ -6524,7 +6524,7 @@ void clif_party_member_info(struct party_data *p, struct map_session_data *sd)
WBUFB(buf,14) = (p->party.member[i].online)?0:1;
memcpy(WBUFP(buf,15), p->party.name, NAME_LENGTH);
memcpy(WBUFP(buf,39), sd->status.name, NAME_LENGTH);
- mapindex_getmapname_ext(map[sd->bl.m].cName ? map[sd->bl.m].cName : map[sd->bl.m].name, (char*)WBUFP(buf,63));
+ mapindex_getmapname_ext(map[sd->bl.m].custom_name ? map[map[sd->bl.m].instance_src_map].name : map[sd->bl.m].name, (char*)WBUFP(buf,63));
WBUFB(buf,79) = (p->party.item&1)?1:0;
WBUFB(buf,80) = (p->party.item&2)?1:0;
clif->send(buf,packet_len(0x1e9),&sd->bl,PARTY);