Fixed a potential crash on change map events (#3699)

* Fixes #3687.
* When changing to an unknown map (or one on another map-server) the instance checks attempted to check null data.
Thanks to @lelouch22!
This commit is contained in:
Aleos
2018-11-27 09:46:20 -05:00
committed by GitHub
parent 16c2f22fed
commit 505a0cd888

View File

@@ -5502,7 +5502,7 @@ enum e_setpos pc_setpos(struct map_session_data* sd, unsigned short mapindex, in
sd->state.workinprogress = WIP_DISABLE_NONE;
if( sd->state.changemap ) { // Misc map-changing settings
unsigned short curr_map_instance_id = map_getmapdata(sd->bl.m)->instance_id, new_map_instance_id = mapdata->instance_id;
unsigned short curr_map_instance_id = map_getmapdata(sd->bl.m)->instance_id, new_map_instance_id = (mapdata ? mapdata->instance_id : 0);
if (curr_map_instance_id != new_map_instance_id) {
if (curr_map_instance_id) // Update instance timer for the map on leave