summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-02-02 18:35:15 -0200
committershennetsind <ind@henn.et>2014-02-02 18:35:15 -0200
commit9132878d911cfe720eaad94ad3d4a5dd11958f99 (patch)
treee24e9668836c9cf8d6856b12a8f75a261502a3f4 /src/map/status.c
parent00ef66fb9261a50e6761cf77c11e7f468494c95f (diff)
downloadhercules-9132878d911cfe720eaad94ad3d4a5dd11958f99.tar.gz
hercules-9132878d911cfe720eaad94ad3d4a5dd11958f99.tar.bz2
hercules-9132878d911cfe720eaad94ad3d4a5dd11958f99.tar.xz
hercules-9132878d911cfe720eaad94ad3d4a5dd11958f99.zip
Fixed Bug 7962
Fixed issue with "permanent" (durationless) status changes (such as carts) integrity caused on server shutdown. Special Thanks to Haru! http://hercules.ws/board/tracker/issue-7962-command-at/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 2b0aee97b..4114bc859 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -9142,8 +9142,11 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
sce->val4 = val4;
if (tick >= 0)
sce->timer = timer->add(timer->gettick() + tick, status->change_timer, bl->id, type);
- else
+ else {
sce->timer = INVALID_TIMER; //Infinite duration
+ if( sd )
+ chrif->save_scdata_single(sd->status.account_id,sd->status.char_id,type,sce);
+ }
if (calc_flag)
status_calc_bl(bl,calc_flag);
@@ -9324,6 +9327,9 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
if (sce->timer != tid && tid != INVALID_TIMER)
return 0;
+ if( sd && sce->timer == INVALID_TIMER )
+ chrif->del_scdata_single(sd->status.account_id,sd->status.char_id,type);
+
if (tid == INVALID_TIMER) {
if (type == SC_ENDURE && sce->val4)
//Do not end infinite endure.