|
@@ -5493,22 +5493,23 @@ enum e_setpos pc_setpos(struct map_session_data* sd, unsigned short mapindex, in
|
|
|
|
|
|
if( sd->state.changemap ) { // Misc map-changing settings
|
|
if( sd->state.changemap ) { // Misc map-changing settings
|
|
int i;
|
|
int i;
|
|
|
|
+ unsigned short instance_id = map_getmapdata(sd->bl.m)->instance_id;
|
|
|
|
|
|
- if(map_getmapdata(sd->bl.m)->instance_id && !mapdata->instance_id) {
|
|
|
|
- bool instance_found = false;
|
|
|
|
|
|
+ if (instance_id && instance_id != mapdata->instance_id) {
|
|
struct party_data *p = NULL;
|
|
struct party_data *p = NULL;
|
|
struct guild *g = NULL;
|
|
struct guild *g = NULL;
|
|
|
|
+ struct clan *cd = NULL;
|
|
|
|
|
|
- if (sd->instance_id) {
|
|
|
|
|
|
+ if (sd->instance_id)
|
|
instance_delusers(sd->instance_id);
|
|
instance_delusers(sd->instance_id);
|
|
- instance_found = true;
|
|
|
|
- }
|
|
|
|
- if (!instance_found && sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id) {
|
|
|
|
|
|
+ else if (sd->status.party_id && (p = party_search(sd->status.party_id)) != NULL && p->instance_id)
|
|
instance_delusers(p->instance_id);
|
|
instance_delusers(p->instance_id);
|
|
- instance_found = true;
|
|
|
|
- }
|
|
|
|
- if (!instance_found && sd->status.guild_id && (g = guild_search(sd->status.guild_id)) != NULL && g->instance_id)
|
|
|
|
|
|
+ else if (sd->status.guild_id && (g = guild_search(sd->status.guild_id)) != NULL && g->instance_id)
|
|
instance_delusers(g->instance_id);
|
|
instance_delusers(g->instance_id);
|
|
|
|
+ else if (sd->status.clan_id && (cd = clan_search(sd->status.clan_id)) != NULL && cd->instance_id)
|
|
|
|
+ instance_delusers(cd->instance_id);
|
|
|
|
+ else
|
|
|
|
+ instance_delusers(instance_id);
|
|
}
|
|
}
|
|
|
|
|
|
sd->state.pmap = sd->bl.m;
|
|
sd->state.pmap = sd->bl.m;
|