소스 검색

Fixes IM_CHAR instances to persist relog (#5088)

* Fixes #3132.
* Fixes IM_CHAR instances not persisting relogs.
Thanks to @ghTravis!
Aleos 4 년 전
부모
커밋
82f3ff9fb6
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  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)