diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp index b04e7848e2..bd867771e8 100644 --- a/src/map/chrif.cpp +++ b/src/map/chrif.cpp @@ -339,6 +339,12 @@ 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; + } } } } diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 54d106a80e..c79b0fb00c 100755 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -2121,7 +2121,7 @@ void pc_reg_received(struct map_session_data *sd) clif_instance_info( *sd ); #endif - if( battle_config.feature_goldpc_active && pc_readreg2( sd, GOLDPC_POINT_VAR ) < battle_config.feature_goldpc_max_points ){ + if( battle_config.feature_goldpc_active && pc_readreg2( sd, GOLDPC_POINT_VAR ) < battle_config.feature_goldpc_max_points && !sd->state.autotrade ){ sd->goldpc_tid = add_timer( gettick() + ( battle_config.feature_goldpc_time - pc_readreg2( sd, GOLDPC_SECONDS_VAR ) ) * 1000, pc_goldpc_update, sd->bl.id, (intptr_t)nullptr ); #ifndef VIP_ENABLE clif_goldpc_info( *sd ); diff --git a/src/map/pc.hpp b/src/map/pc.hpp index 46b7a1610c..1255f590f1 100644 --- a/src/map/pc.hpp +++ b/src/map/pc.hpp @@ -1712,4 +1712,6 @@ void pc_macro_detector_disconnect(map_session_data &sd); void pc_macro_reporter_area_select(map_session_data &sd, const int16 x, const int16 y, const int8 radius); void pc_macro_reporter_process(map_session_data &ssd, map_session_data &tsd); +TIMER_FUNC(pc_goldpc_update); + #endif /* PC_HPP */