summaryrefslogtreecommitdiff
path: root/src/map/instance.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-09-21 03:47:19 +0200
committerHaru <haru@dotalux.com>2013-09-21 03:50:26 +0200
commit51241f66ad6e78cf56b91c41e524c00a1d5abeb2 (patch)
tree0b03082e62425d126bbff387f09cad4ab0f2bd24 /src/map/instance.c
parent556834d0508101b70660c5904b24adacacced3e0 (diff)
downloadhercules-51241f66ad6e78cf56b91c41e524c00a1d5abeb2.tar.gz
hercules-51241f66ad6e78cf56b91c41e524c00a1d5abeb2.tar.bz2
hercules-51241f66ad6e78cf56b91c41e524c00a1d5abeb2.tar.xz
hercules-51241f66ad6e78cf56b91c41e524c00a1d5abeb2.zip
Fixed a potentially negative array subscript causing a mapserver crash
- Fixes bugreport:7717, special thanks to quesoph http://hercules.ws/board/tracker/issue-7717-map-crash-when-warping-on-a-floating-npc/ - Also changed various map[foo].index to the map_id2index(foo) macro. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/instance.c')
-rw-r--r--src/map/instance.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/instance.c b/src/map/instance.c
index 98a0dfc8f..cb5464b24 100644
--- a/src/map/instance.c
+++ b/src/map/instance.c
@@ -377,7 +377,7 @@ void instance_del_map(int16 m) {
if( map[m].mob_delete_timer != INVALID_TIMER )
iTimer->delete_timer(map[m].mob_delete_timer, iMap->removemobs_timer);
- mapindex_removemap( map[m].index );
+ mapindex_removemap(map_id2index(m));
// Free memory
aFree(map[m].cell);