Fixed a few more leftovers from 64bit tick (#3885)
Fixes #3864 Thanks to @darhylism, @nubspixel, @Daegaladh and @aleos89!
This commit is contained in:
parent
b1b9720f2a
commit
a5fc39e0e3
@ -7233,7 +7233,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
|
||||
}
|
||||
if (rnd()%100 < triple_rate) {
|
||||
//Need to apply canact_tick here because it doesn't go through skill_castend_id
|
||||
sd->ud.canact_tick = max(tick + skill_delayfix(src, MO_TRIPLEATTACK, skillv), sd->ud.canact_tick);
|
||||
sd->ud.canact_tick = i64max(tick + skill_delayfix(src, MO_TRIPLEATTACK, skillv), sd->ud.canact_tick);
|
||||
if( skill_attack(BF_WEAPON,src,src,target,MO_TRIPLEATTACK,skillv,tick,0) )
|
||||
return ATK_DEF;
|
||||
return ATK_MISS;
|
||||
@ -7443,7 +7443,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
|
||||
int autospell_tick = skill_delayfix(src, skill_id, skill_lv);
|
||||
|
||||
if (DIFF_TICK(ud->canact_tick, tick + autospell_tick) < 0) {
|
||||
ud->canact_tick = max(tick + autospell_tick, ud->canact_tick);
|
||||
ud->canact_tick = i64max(tick + autospell_tick, ud->canact_tick);
|
||||
if (battle_config.display_status_timers && sd)
|
||||
clif_status_change(src, EFST_POSTDELAY, 1, autospell_tick, 0, 0, 0);
|
||||
}
|
||||
@ -7507,7 +7507,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
|
||||
}
|
||||
sd->state.autocast = 0;
|
||||
|
||||
sd->ud.canact_tick = max(tick + skill_delayfix(src, r_skill, r_lv), sd->ud.canact_tick);
|
||||
sd->ud.canact_tick = i64max(tick + skill_delayfix(src, r_skill, r_lv), sd->ud.canact_tick);
|
||||
clif_status_change(src, EFST_POSTDELAY, 1, skill_delayfix(src, r_skill, r_lv), 0, 0, 1);
|
||||
}
|
||||
}
|
||||
|
@ -19544,7 +19544,7 @@ void clif_parse_roulette_generate( int fd, struct map_session_data* sd ){
|
||||
sd->roulette.prizeStage = sd->roulette.stage;
|
||||
sd->roulette.prizeIdx = rnd()%rd.items[sd->roulette.stage];
|
||||
sd->roulette.claimPrize = true;
|
||||
sd->roulette.tick = gettick() + max( 1, ( MAX_ROULETTE_COLUMNS - sd->roulette.prizeStage - 3 ) ) * 1000;
|
||||
sd->roulette.tick = gettick() + i64max( 1, ( MAX_ROULETTE_COLUMNS - sd->roulette.prizeStage - 3 ) ) * 1000;
|
||||
|
||||
if( rd.flag[sd->roulette.stage][sd->roulette.prizeIdx]&1 ){
|
||||
result = GENERATE_ROULETTE_LOSING;
|
||||
|
@ -5,11 +5,12 @@
|
||||
#define ELEMENTAL_HPP
|
||||
|
||||
#include "../common/mmo.hpp"
|
||||
#include "../common/timer.hpp"
|
||||
|
||||
#include "status.hpp" // struct status_data, struct status_change
|
||||
#include "unit.hpp" // struct unit_data
|
||||
|
||||
#define MIN_ELETHINKTIME 100
|
||||
const t_tick MIN_ELETHINKTIME = 100;
|
||||
#define MIN_ELEDISTANCE 2
|
||||
#define MAX_ELEDISTANCE 5
|
||||
|
||||
|
@ -52,7 +52,7 @@ using namespace rathena;
|
||||
// Move probability for mobs away from players (rate of 1000 minute)
|
||||
// in Aegis, this is 100% for mobs that have been activated by players and none otherwise.
|
||||
#define MOB_LAZYMOVEPERC(md) (mob_is_spotted(md)?1000:0)
|
||||
#define MOB_MAX_DELAY (24*3600*1000)
|
||||
const t_tick MOB_MAX_DELAY = 24 * 3600 * 1000;
|
||||
#define MAX_MINCHASE 30 //Max minimum chase value to use for mobs.
|
||||
#define RUDE_ATTACKED_COUNT 1 //After how many rude-attacks should the skill be used?
|
||||
|
||||
|
@ -26,11 +26,11 @@ struct guardian_data;
|
||||
#define MAX_RACE2_MOBS 100
|
||||
|
||||
//Min time between AI executions
|
||||
#define MIN_MOBTHINKTIME 100
|
||||
const t_tick MIN_MOBTHINKTIME = 100;
|
||||
//Min time before mobs do a check to call nearby friends for help (or for slaves to support their master)
|
||||
#define MIN_MOBLINKTIME 1000
|
||||
const t_tick MIN_MOBLINKTIME = 1000;
|
||||
//Min time between random walks
|
||||
#define MIN_RANDOMWALKTIME 4000
|
||||
const t_tick MIN_RANDOMWALKTIME = 4000;
|
||||
|
||||
//Distance that slaves should keep from their master.
|
||||
#define MOB_SLAVEDISTANCE 2
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
using namespace rathena;
|
||||
|
||||
#define MIN_PETTHINKTIME 100
|
||||
const t_tick MIN_PETTHINKTIME = 100;
|
||||
|
||||
//Dynamic pet database
|
||||
std::map<uint16, struct s_pet_db> pet_db_data;
|
||||
|
@ -2068,7 +2068,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
|
||||
if (ud) {
|
||||
rate = skill_delayfix(src, skill, skill_lv);
|
||||
if (DIFF_TICK(ud->canact_tick, tick + rate) < 0){
|
||||
ud->canact_tick = max(tick + rate, ud->canact_tick);
|
||||
ud->canact_tick = i64max(tick + rate, ud->canact_tick);
|
||||
if ( battle_config.display_status_timers )
|
||||
clif_status_change(src, EFST_POSTDELAY, 1, rate, 0, 0, 0);
|
||||
}
|
||||
@ -2161,7 +2161,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
|
||||
if (ud) {
|
||||
rate = skill_delayfix(src, skill, autospl_skill_lv);
|
||||
if (DIFF_TICK(ud->canact_tick, tick + rate) < 0){
|
||||
ud->canact_tick = max(tick + rate, ud->canact_tick);
|
||||
ud->canact_tick = i64max(tick + rate, ud->canact_tick);
|
||||
if ( battle_config.display_status_timers && sd )
|
||||
clif_status_change(src, EFST_POSTDELAY, 1, rate, 0, 0, 0);
|
||||
}
|
||||
@ -2493,7 +2493,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
|
||||
if (ud) {
|
||||
autospl_rate = skill_delayfix(bl, autospl_skill_id, autospl_skill_lv);
|
||||
if (DIFF_TICK(ud->canact_tick, tick + autospl_rate) < 0){
|
||||
ud->canact_tick = max(tick + autospl_rate, ud->canact_tick);
|
||||
ud->canact_tick = i64max(tick + autospl_rate, ud->canact_tick);
|
||||
if ( battle_config.display_status_timers && dstsd )
|
||||
clif_status_change(bl, EFST_POSTDELAY, 1, autospl_rate, 0, 0, 0);
|
||||
}
|
||||
@ -4194,7 +4194,7 @@ static TIMER_FUNC(skill_timerskill){
|
||||
// Official behaviour is to hit as long as there is a line of sight, regardless of distance
|
||||
if (skl->type > 0 && !status_isdead(target) && path_search_long(NULL,src->m,src->x,src->y,target->x,target->y,CELL_CHKWALL)) {
|
||||
// Apply canact delay here to prevent hacks (unlimited casting)
|
||||
ud->canact_tick = max(tick + status_get_amotion(src), ud->canact_tick);
|
||||
ud->canact_tick = i64max(tick + status_get_amotion(src), ud->canact_tick);
|
||||
skill_attack(BF_MAGIC, src, src, target, skl->skill_id, skl->skill_lv, tick, skl->flag);
|
||||
}
|
||||
if (unit && !status_isdead(target) && !status_isdead(src)) {
|
||||
@ -5659,7 +5659,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
|
||||
break;
|
||||
}
|
||||
|
||||
sd->ud.canact_tick = max(tick + skill_delayfix(src, pres_skill_id, pres_skill_lv), sd->ud.canact_tick);
|
||||
sd->ud.canact_tick = i64max(tick + skill_delayfix(src, pres_skill_id, pres_skill_lv), sd->ud.canact_tick);
|
||||
clif_status_change(src, EFST_POSTDELAY, 1, skill_delayfix(src, pres_skill_id, pres_skill_lv), 0, 0, 0);
|
||||
|
||||
cooldown = pc_get_skillcooldown(sd,pres_skill_id, pres_skill_lv);
|
||||
@ -11399,7 +11399,7 @@ TIMER_FUNC(skill_castend_id){
|
||||
unit_stop_walking(src,1);
|
||||
|
||||
if (!sd || sd->skillitem != ud->skill_id || skill_get_delay(ud->skill_id, ud->skill_lv))
|
||||
ud->canact_tick = max(tick + skill_delayfix(src, ud->skill_id, ud->skill_lv), ud->canact_tick - SECURITY_CASTTIME);
|
||||
ud->canact_tick = i64max(tick + skill_delayfix(src, ud->skill_id, ud->skill_lv), ud->canact_tick - SECURITY_CASTTIME);
|
||||
if (sd) { //Cooldown application
|
||||
int cooldown = pc_get_skillcooldown(sd,ud->skill_id, ud->skill_lv); // Increases/Decreases cooldown of a skill by item/card bonuses.
|
||||
if(cooldown) skill_blockpc_start(sd, ud->skill_id, cooldown);
|
||||
@ -11625,7 +11625,7 @@ TIMER_FUNC(skill_castend_pos){
|
||||
unit_stop_walking(src,1);
|
||||
|
||||
if (!sd || sd->skillitem != ud->skill_id || skill_get_delay(ud->skill_id, ud->skill_lv))
|
||||
ud->canact_tick = max(tick + skill_delayfix(src, ud->skill_id, ud->skill_lv), ud->canact_tick - SECURITY_CASTTIME);
|
||||
ud->canact_tick = i64max(tick + skill_delayfix(src, ud->skill_id, ud->skill_lv), ud->canact_tick - SECURITY_CASTTIME);
|
||||
if (sd) { //Cooldown application
|
||||
int cooldown = pc_get_skillcooldown(sd,ud->skill_id, ud->skill_lv);
|
||||
if(cooldown) skill_blockpc_start(sd, ud->skill_id, cooldown);
|
||||
@ -13413,7 +13413,7 @@ static int skill_unit_onplace(struct skill_unit *unit, struct block_list *bl, t_
|
||||
//Overwrite status change with new duration
|
||||
if ((td = get_timer(sc->data[type]->timer))!=NULL)
|
||||
status_change_start(ss, bl, type, 10000, sc->data[type]->val1 + 1, sc->data[type]->val2, sc->data[type]->val3, sc->data[type]->val4,
|
||||
max(DIFF_TICK(td->tick, tick), sec), SCSTART_NORATEDEF);
|
||||
i64max(DIFF_TICK(td->tick, tick), sec), SCSTART_NORATEDEF);
|
||||
}
|
||||
else {
|
||||
if (status_change_start(ss, bl, type, 10000, 1, sg->group_id, 0, 0, sec, SCSTART_NORATEDEF)) {
|
||||
|
@ -115,7 +115,7 @@ enum e_skill_inf3 {
|
||||
|
||||
/// Time that's added to canact delay on castbegin and substracted on castend
|
||||
/// This is to prevent hackers from sending a skill packet after cast but before a timer triggers castend
|
||||
#define SECURITY_CASTTIME 100
|
||||
const t_tick SECURITY_CASTTIME = 100;
|
||||
|
||||
/// Flags passed to skill_attack/skill_area_sub
|
||||
enum e_skill_display {
|
||||
|
@ -1886,7 +1886,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
|
||||
ud->state.skillcastcancel = 0;
|
||||
|
||||
if (!sd || sd->skillitem != skill_id || skill_get_cast(skill_id, skill_lv))
|
||||
ud->canact_tick = tick + max(casttime, max(status_get_amotion(src), battle_config.min_skill_delay_limit)) + SECURITY_CASTTIME;
|
||||
ud->canact_tick = tick + i64max(casttime, max(status_get_amotion(src), battle_config.min_skill_delay_limit)) + SECURITY_CASTTIME;
|
||||
|
||||
if( sd ) {
|
||||
switch( skill_id ) {
|
||||
@ -2058,7 +2058,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui
|
||||
|
||||
ud->state.skillcastcancel = castcancel&&casttime>0?1:0;
|
||||
if (!sd || sd->skillitem != skill_id || skill_get_cast(skill_id, skill_lv))
|
||||
ud->canact_tick = tick + max(casttime, max(status_get_amotion(src), battle_config.min_skill_delay_limit)) + SECURITY_CASTTIME;
|
||||
ud->canact_tick = tick + i64max(casttime, max(status_get_amotion(src), battle_config.min_skill_delay_limit)) + SECURITY_CASTTIME;
|
||||
|
||||
// if( sd )
|
||||
// {
|
||||
|
Loading…
x
Reference in New Issue
Block a user