diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/status.c | 10 | ||||
-rw-r--r-- | src/map/status.h | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/map/status.c b/src/map/status.c index c2640c070..3a4db3752 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -9597,14 +9597,18 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t ++(sc->count); sce = sc->data[type] = ers_alloc(status->data_ers, struct status_change_entry); } + sce->val1 = val1; sce->val2 = val2; sce->val3 = val3; sce->val4 = val4; - if (tick >= 0) + + if (tick >= 0) { sce->timer = timer->add(timer->gettick() + tick, status->change_timer, bl->id, type); - else { + sce->infinite_duration = false; + } else { sce->timer = INVALID_TIMER; //Infinite duration + sce->infinite_duration = true; if( sd ) chrif->save_scdata_single(sd->status.account_id,sd->status.char_id,type,sce); } @@ -9790,7 +9794,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const st = status->get_status_data(bl); - if( sd && sce->timer == INVALID_TIMER && !sd->state.loggingout ) + if( sd && sce->infinite_duration && !sd->state.loggingout ) chrif->del_scdata_single(sd->status.account_id,sd->status.char_id,type); if (tid == INVALID_TIMER) { diff --git a/src/map/status.h b/src/map/status.h index f281a4d08..f0624587e 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -1868,6 +1868,7 @@ struct sc_display_entry { struct status_change_entry { int timer; int val1,val2,val3,val4; + bool infinite_duration; }; struct status_change { |