diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/chrif.c | 8 | ||||
-rw-r--r-- | src/map/clif.c | 6 | ||||
-rw-r--r-- | src/map/duel.c | 18 | ||||
-rw-r--r-- | src/map/npc.c | 6 | ||||
-rw-r--r-- | src/map/pet.c | 8 | ||||
-rw-r--r-- | src/map/script.c | 29 | ||||
-rw-r--r-- | src/map/skill.c | 4 | ||||
-rw-r--r-- | src/map/status.c | 13 |
8 files changed, 43 insertions, 49 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c index 53ef808a0..cb0f29b4e 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -1170,7 +1170,7 @@ int chrif_save_scdata(struct map_session_data *sd) { //parses the sc_data of the unsigned int tick; struct status_change_data data; struct status_change *sc = &sd->sc; - const struct TimerData *timer; + const struct TimerData *td; chrif_check(-1); tick = iTimer->gettick(); @@ -1184,10 +1184,10 @@ int chrif_save_scdata(struct map_session_data *sd) { //parses the sc_data of the if (!sc->data[i]) continue; if (sc->data[i]->timer != INVALID_TIMER) { - timer = iTimer->get_timer(sc->data[i]->timer); - if (timer == NULL || timer->func != iStatus->change_timer || DIFF_TICK(timer->tick,tick) < 0) + td = iTimer->get_timer(sc->data[i]->timer); + if (td == NULL || td->func != iStatus->change_timer || DIFF_TICK(td->tick,tick) < 0) continue; - data.tick = DIFF_TICK(timer->tick,tick); //Duration that is left before ending. + data.tick = DIFF_TICK(td->tick,tick); //Duration that is left before ending. } else data.tick = -1; //Infinite duration data.type = i; diff --git a/src/map/clif.c b/src/map/clif.c index 513ec0d7c..9ea7f6a2e 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9945,9 +9945,9 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd) if( unit->is_walking(&sd->bl) ) clif->move(&sd->ud); } else if ( sd->disguise == sd->status.class_ && sd->fontcolor_tid != INVALID_TIMER ) { - const struct TimerData *timer; - if( (timer = iTimer->get_timer(sd->fontcolor_tid)) ) { - iTimer->settick_timer(sd->fontcolor_tid, timer->tick+5000); + const struct TimerData *td; + if( (td = iTimer->get_timer(sd->fontcolor_tid)) ) { + iTimer->settick_timer(sd->fontcolor_tid, td->tick+5000); } } diff --git a/src/map/duel.c b/src/map/duel.c index 8be1baf5c..1291dd02b 100644 --- a/src/map/duel.c +++ b/src/map/duel.c @@ -17,25 +17,23 @@ /*========================================== * Duel organizing functions [LuzZza] *------------------------------------------*/ -void duel_savetime(struct map_session_data* sd) -{ - time_t timer; +void duel_savetime(struct map_session_data* sd) { + time_t clock; struct tm *t; - time(&timer); - t = localtime(&timer); + time(&clock); + t = localtime(&clock); pc_setglobalreg(sd, "PC_LAST_DUEL_TIME", t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min); } -int duel_checktime(struct map_session_data* sd) -{ +int duel_checktime(struct map_session_data* sd) { int diff; - time_t timer; + time_t clock; struct tm *t; - time(&timer); - t = localtime(&timer); + time(&clock); + t = localtime(&clock); diff = t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min - pc_readglobalreg(sd, "PC_LAST_DUEL_TIME"); diff --git a/src/map/npc.c b/src/map/npc.c index 6ab8df2fa..348829935 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -398,13 +398,13 @@ int npc_event_doall(const char* name) int npc_event_do_clock(int tid, unsigned int tick, int id, intptr_t data) { static struct tm ev_tm_b; // tracks previous execution time - time_t timer; + time_t clock; struct tm* t; char buf[64]; int c = 0; - timer = time(NULL); - t = localtime(&timer); + clock = time(NULL); + t = localtime(&clock); if (t->tm_min != ev_tm_b.tm_min ) { char* day; diff --git a/src/map/pet.c b/src/map/pet.c index 8498517ef..6b8ac947e 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -1049,7 +1049,7 @@ int pet_skill_bonus_timer(int tid, unsigned int tick, int id, intptr_t data) struct map_session_data *sd=iMap->id2sd(id); struct pet_data *pd; int bonus; - int timer = 0; + int duration = 0; if(sd == NULL || sd->pd==NULL || sd->pd->bonus == NULL) return 1; @@ -1065,10 +1065,10 @@ int pet_skill_bonus_timer(int tid, unsigned int tick, int id, intptr_t data) // determine the time for the next timer if (pd->state.skillbonus && pd->bonus->delay > 0) { bonus = 0; - timer = pd->bonus->delay*1000; // the duration until pet bonuses will be reactivated again + duration = pd->bonus->delay*1000; // the duration until pet bonuses will be reactivated again } else if (pd->pet.intimate) { bonus = 1; - timer = pd->bonus->duration*1000; // the duration for pet bonuses to be in effect + duration = pd->bonus->duration*1000; // the duration for pet bonuses to be in effect } else { //Lost pet... pd->bonus->timer = INVALID_TIMER; return 0; @@ -1079,7 +1079,7 @@ int pet_skill_bonus_timer(int tid, unsigned int tick, int id, intptr_t data) status_calc_pc(sd, 0); } // wait for the next timer - pd->bonus->timer=iTimer->add_timer(tick+timer,pet->skill_bonus_timer,sd->bl.id,0); + pd->bonus->timer=iTimer->add_timer(tick+duration,pet->skill_bonus_timer,sd->bl.id,0); return 0; } diff --git a/src/map/script.c b/src/map/script.c index 86d69658c..fcf10f972 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -8150,10 +8150,9 @@ BUILDIN(savepoint) /*========================================== * GetTimeTick(0: System Tick, 1: Time Second Tick) *------------------------------------------*/ -BUILDIN(gettimetick) /* Asgard Version */ -{ +BUILDIN(gettimetick) { /* Asgard Version */ int type; - time_t timer; + time_t clock; struct tm *t; type=script_getnum(st,2); @@ -8166,8 +8165,8 @@ BUILDIN(gettimetick) /* Asgard Version */ break; case 1: //type 1:(Second Ticks: 0-86399, 00:00:00-23:59:59) - time(&timer); - t=localtime(&timer); + time(&clock); + t=localtime(&clock); script_pushint(st,((t->tm_hour)*3600+(t->tm_min)*60+t->tm_sec)); break; case 0: @@ -8185,16 +8184,15 @@ BUILDIN(gettimetick) /* Asgard Version */ * 4: WeekDay 5: MonthDay 6: Month * 7: Year *------------------------------------------*/ -BUILDIN(gettime) /* Asgard Version */ -{ +BUILDIN(gettime) { /* Asgard Version */ int type; - time_t timer; + time_t clock; struct tm *t; type=script_getnum(st,2); - time(&timer); - t=localtime(&timer); + time(&clock); + t=localtime(&clock); switch(type){ case 1://Sec(0~59) @@ -9715,19 +9713,18 @@ BUILDIN(getstatus) return true; } - switch( type ) - { + switch( type ) { case 1: script_pushint(st, sd->sc.data[id]->val1); break; case 2: script_pushint(st, sd->sc.data[id]->val2); break; case 3: script_pushint(st, sd->sc.data[id]->val3); break; case 4: script_pushint(st, sd->sc.data[id]->val4); break; case 5: { - struct TimerData* timer = (struct TimerData*)iTimer->get_timer(sd->sc.data[id]->timer); + struct TimerData* td = (struct TimerData*)iTimer->get_timer(sd->sc.data[id]->timer); - if( timer ) - {// return the amount of time remaining - script_pushint(st, timer->tick - iTimer->gettick()); + if( td ) { + // return the amount of time remaining + script_pushint(st, td->tick - iTimer->gettick()); } } break; diff --git a/src/map/skill.c b/src/map/skill.c index 75df03b1b..c178bc074 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4807,8 +4807,8 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data) case NPC_GRANDDARKNESS: if( (sc = iStatus->get_sc(src)) && sc->data[SC_NOEQUIPSHIELD] ) { - const struct TimerData *timer = iTimer->get_timer(sc->data[SC_NOEQUIPSHIELD]->timer); - if( timer && timer->func == iStatus->change_timer && DIFF_TICK(timer->tick,iTimer->gettick()+skill->get_time(ud->skill_id, ud->skill_lv)) > 0 ) + const struct TimerData *td = iTimer->get_timer(sc->data[SC_NOEQUIPSHIELD]->timer); + if( td && td->func == iStatus->change_timer && DIFF_TICK(td->tick,iTimer->gettick()+skill->get_time(ud->skill_id, ud->skill_lv)) > 0 ) break; } sc_start2(src, SC_NOEQUIPSHIELD, 100, 0, 1, skill->get_time(ud->skill_id, ud->skill_lv)); diff --git a/src/map/status.c b/src/map/status.c index 4f4edf31f..e3521b32b 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -10312,9 +10312,9 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data) case SC_SPLASHER: // custom Venom Splasher countdown timer //if (sce->val4 % 1000 == 0) { - // char timer[10]; - // snprintf (timer, 10, "%d", sce->val4/1000); - // clif->message(bl, timer); + // char counter[10]; + // snprintf (counter, 10, "%d", sce->val4/1000); + // clif->message(bl, counter); //} if((sce->val4 -= 500) > 0) { sc_timer_next(500 + tick, iStatus->change_timer, bl->id, data); @@ -11125,7 +11125,6 @@ int status_change_clear_buffs (struct block_list* bl, int type) int status_change_spread( struct block_list *src, struct block_list *bl ) { int i, flag = 0; struct status_change *sc = iStatus->get_sc(src); - const struct TimerData *timer; unsigned int tick; struct status_change_data data; @@ -11165,10 +11164,10 @@ int status_change_spread( struct block_list *src, struct block_list *bl ) { case SC_DEATHHURT: case SC_PARALYSE: if( sc->data[i]->timer != INVALID_TIMER ) { - timer = iTimer->get_timer(sc->data[i]->timer); - if (timer == NULL || timer->func != iStatus->change_timer || DIFF_TICK(timer->tick,tick) < 0) + const struct TimerData *td = iTimer->get_timer(sc->data[i]->timer); + if (td == NULL || td->func != iStatus->change_timer || DIFF_TICK(td->tick,tick) < 0) continue; - data.tick = DIFF_TICK(timer->tick,tick); + data.tick = DIFF_TICK(td->tick,tick); } else data.tick = INVALID_TIMER; break; |