Fixes IM_CHAR instances to persist relog (#5088)

* Fixes #3132.
* Fixes IM_CHAR instances not persisting relogs.
Thanks to @ghTravis!
This commit is contained in:
Aleos
2020-06-15 16:53:42 -04:00
committed by GitHub
parent 60d03a1978
commit 82f3ff9fb6

View File

@@ -1908,6 +1908,14 @@ void pc_reg_received(struct map_session_data *sd)
}
channel_autojoin(sd);
// Restore IM_CHAR instance to the player
for (const auto &instance : instances) {
if (instance.second->mode == IM_CHAR && instance.second->owner_id == sd->status.char_id) {
sd->instance_id = instance.first;
break;
}
}
}
static int pc_calc_skillpoint(struct map_session_data* sd)