Invincible timer clean
* Remove a possible timer even if passing an invalid time value.
This commit is contained in:
parent
34065e4ca6
commit
772c6f33ff
@ -776,8 +776,13 @@ static TIMER_FUNC(pc_invincible_timer){
|
|||||||
void pc_setinvincibletimer(map_session_data* sd, int val) {
|
void pc_setinvincibletimer(map_session_data* sd, int val) {
|
||||||
nullpo_retv(sd);
|
nullpo_retv(sd);
|
||||||
|
|
||||||
if (val <= 0)
|
if (val <= 0) {
|
||||||
|
if (sd->invincible_timer != INVALID_TIMER) {
|
||||||
|
delete_timer(sd->invincible_timer, pc_invincible_timer);
|
||||||
|
sd->invincible_timer = INVALID_TIMER;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( sd->invincible_timer != INVALID_TIMER )
|
if( sd->invincible_timer != INVALID_TIMER )
|
||||||
delete_timer(sd->invincible_timer,pc_invincible_timer);
|
delete_timer(sd->invincible_timer,pc_invincible_timer);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user