Quellcode durchsuchen

Fixes IM_CHAR instances to persist relog (#5088)

* Fixes #3132.
* Fixes IM_CHAR instances not persisting relogs.
Thanks to @ghTravis!
Aleos vor 4 Jahren
Ursprung
Commit
82f3ff9fb6
1 geänderte Dateien mit 8 neuen und 0 gelöschten Zeilen
  1. 8 0
      src/map/pc.cpp

+ 8 - 0
src/map/pc.cpp

@@ -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)