summaryrefslogtreecommitdiff
path: root/src/map/pc.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/pc.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/pc.c')
-rw-r--r--src/map/pc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 13e2ec8d2..044e55508 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4822,7 +4822,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
if( sd->instances ) {
for( i = 0; i < sd->instances; i++ ) {
if( sd->instance[i] >= 0 ) {
- ARR_FIND(0, instances[sd->instance[i]].num_map, j, map[instances[sd->instance[i]].map[j]].instance_src_map == m && !map[instances[sd->instance[i]].map[j]].cName);
+ ARR_FIND(0, instances[sd->instance[i]].num_map, j, map[instances[sd->instance[i]].map[j]].instance_src_map == m && !map[instances[sd->instance[i]].map[j]].custom_name);
if( j != instances[sd->instance[i]].num_map )
break;
}
@@ -4836,7 +4836,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
if ( !stop && sd->status.party_id && (p = party->search(sd->status.party_id)) && p->instances ) {
for( i = 0; i < p->instances; i++ ) {
if( p->instance[i] >= 0 ) {
- ARR_FIND(0, instances[p->instance[i]].num_map, j, map[instances[p->instance[i]].map[j]].instance_src_map == m && !map[instances[p->instance[i]].map[j]].cName);
+ ARR_FIND(0, instances[p->instance[i]].num_map, j, map[instances[p->instance[i]].map[j]].instance_src_map == m && !map[instances[p->instance[i]].map[j]].custom_name);
if( j != instances[p->instance[i]].num_map )
break;
}
@@ -4850,7 +4850,7 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
if ( !stop && sd->status.guild_id && sd->guild && sd->guild->instances ) {
for( i = 0; i < sd->guild->instances; i++ ) {
if( sd->guild->instance[i] >= 0 ) {
- ARR_FIND(0, instances[sd->guild->instance[i]].num_map, j, map[instances[sd->guild->instance[i]].map[j]].instance_src_map == m && !map[instances[sd->guild->instance[i]].map[j]].cName);
+ ARR_FIND(0, instances[sd->guild->instance[i]].num_map, j, map[instances[sd->guild->instance[i]].map[j]].instance_src_map == m && !map[instances[sd->guild->instance[i]].map[j]].custom_name);
if( j != instances[sd->guild->instance[i]].num_map )
break;
}