Pārlūkot izejas kodu

Corrected possible item loss during char login (#3714)

* Resolved a rare case if a player logs in and the server hasn't fully initialized all of the player's items that the auto-save timer fires off and saves the player with no items.
Thanks to @Tokeiburu!
Aleos 6 gadi atpakaļ
vecāks
revīzija
6a49dc2b90
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      src/map/pc.cpp

+ 2 - 0
src/map/pc.cpp

@@ -10524,6 +10524,8 @@ static TIMER_FUNC(pc_autosave){
 	iter = mapit_getallusers();
 	for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) )
 	{
+		if (!sd->state.pc_loaded) // Player data hasn't fully loaded
+			continue;
 		if(sd->bl.id == last_save_id && save_flag != 1) {
 			save_flag = 1;
 			continue;