diff options
author | Haru <haru@dotalux.com> | 2013-09-21 03:47:19 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2013-09-21 03:50:26 +0200 |
commit | 51241f66ad6e78cf56b91c41e524c00a1d5abeb2 (patch) | |
tree | 0b03082e62425d126bbff387f09cad4ab0f2bd24 /src/map/intif.c | |
parent | 556834d0508101b70660c5904b24adacacced3e0 (diff) | |
download | hercules-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/intif.c')
-rw-r--r-- | src/map/intif.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/map/intif.c b/src/map/intif.c index ac1471d23..634735bd6 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -458,8 +458,7 @@ int intif_party_leave(int party_id,int account_id, int char_id) } // Request keeping party for new map ?? -int intif_party_changemap(struct map_session_data *sd,int online) -{ +int intif_party_changemap(struct map_session_data *sd,int online) { int16 m, mapindex; if (intif->CheckForCharServer()) @@ -468,7 +467,7 @@ int intif_party_changemap(struct map_session_data *sd,int online) return 0; if( (m=iMap->mapindex2mapid(sd->mapindex)) >= 0 && map[m].instance_id >= 0 ) - mapindex = map[map[m].instance_src_map].index; + mapindex = map_id2index(map[m].instance_src_map); else mapindex = sd->mapindex; |