Cleaned up map data storage (#3347)

Follow up to a942853.
Fixes #3336.
Moved map_data storage to std::map container.
Created map_getmapdata to obtain pointer to map_data.
Got rid of MAX_MAP_PER_SERVER define.
Resolved deletion of instances causing other instances to lose their intended map ID.
Refactored warp suggestions

Thanks to @teededung, @anacondaqq, @cydh and @Lemongrass3110!
This commit is contained in:
Aleos
2018-07-25 19:06:59 -04:00
committed by Lemongrass3110
parent 62ac5be447
commit 584fcac43a
26 changed files with 916 additions and 741 deletions

View File

@@ -879,11 +879,11 @@ int guild_member_withdraw(int guild_id, uint32 account_id, uint32 char_id, int f
sd->guild_emblem_id = 0;
if (g->instance_id) {
int16 m = sd->bl.m;
struct map_data *mapdata = map_getmapdata(sd->bl.m);
if (map[m].instance_id) { // User was on the instance map
if (map[m].save.map)
pc_setpos(sd, map[m].save.map, map[m].save.x, map[m].save.y, CLR_TELEPORT);
if (mapdata->instance_id) { // User was on the instance map
if (mapdata->save.map)
pc_setpos(sd, mapdata->save.map, mapdata->save.x, mapdata->save.y, CLR_TELEPORT);
else
pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
}