Переглянути джерело

Always stop the timer on logout

Thanks to @Tolimatoi
Lemongrass3110 2 роки тому
батько
коміт
4f98d0198f
1 змінених файлів з 3 додано та 5 видалено
  1. 3 5
      src/map/chrif.cpp

+ 3 - 5
src/map/chrif.cpp

@@ -340,11 +340,9 @@ int chrif_save(struct map_session_data *sd, int flag) {
 				// Store the seconds that already fully passed
 				pc_setreg2( sd, GOLDPC_SECONDS_VAR, battle_config.feature_goldpc_time - remaining / 1000 );
 
-				// If player starts autotrade, stop counting
-				if( flag&CSAVE_AUTOTRADE ){
-					delete_timer( sd->goldpc_tid, pc_goldpc_update );
-					sd->goldpc_tid = INVALID_TIMER;
-				}
+				// If a player logs out or starts autotrade, stop counting
+				delete_timer( sd->goldpc_tid, pc_goldpc_update );
+				sd->goldpc_tid = INVALID_TIMER;
 			}
 		}
 	}