From 44c33fda3614d588e6bf6cee1cf884e98f1531f0 Mon Sep 17 00:00:00 2001 From: Haru Date: Fri, 11 Oct 2013 05:07:45 +0200 Subject: Changed 'tick' variables to 64 bit - This fixes an issue with timers that stop working after about 24-49 days when the tick overflows (note that this may happen much earlier than that, and at hard to predict times, on some systems) - Updated the RDTSC help message in the configure script to also warn users about issues with SpeedStep enabled systems. - On Windows, tick() still has a resolution of 10~15ms (or even as low as 100ms on some systems). A TODO comment (thanks, Ai4rei) was added for a follow-up patch, as I want this one to be as small as possible) - Note: on Windows versions earlier than 6.x (Vista, Server 2008), the tick overflow issue is NOT fixed, since they don't support the function used to retrieve a 64 bit tick. This isn't a big issue, since those platforms are already - or going soon to be - out of their extended support period, and it's already advisable to upgrade, for other reasons. If you're the unfortunate user of such a system, it is recommended that you reboot your machine at least once every 49 days for Hercules to work reliably. - Note: To clear some doubts, since I've already been asked, this has absolutely NOTHING to do with 32/64 bit CPUs or OSes. It's all about a variable's size, not the size of registers of your CPU, and your 32bit CPU will be able to handle this just fine. Signed-off-by: Haru --- src/map/battle.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/map/battle.h') diff --git a/src/map/battle.h b/src/map/battle.h index a2212a647..bf08ab8d6 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -518,11 +518,11 @@ struct battle_interface { /* battlegrounds final damage calculation */ int64 (*calc_bg_damage) (struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag); /* normal weapon attack */ - enum damage_lv (*weapon_attack) (struct block_list *bl, struct block_list *target, unsigned int tick, int flag); + enum damage_lv (*weapon_attack) (struct block_list *bl, struct block_list *target, int64 tick, int flag); /* calculate weapon attack */ struct Damage (*calc_weapon_attack) (struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv,int wflag); /* delays damage or skills by a timer */ - int (*delay_damage) (unsigned int tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, uint16 skill_id, uint16 skill_lv, int64 damage, enum damage_lv dmg_lv, int ddelay, bool additional_effects); + int (*delay_damage) (int64 tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, uint16 skill_id, uint16 skill_lv, int64 damage, enum damage_lv dmg_lv, int ddelay, bool additional_effects); /* drain damage */ void (*drain) (struct map_session_data *sd, struct block_list *tbl, int64 rdamage, int64 ldamage, int race, int boss); /* damage return/reflect */ @@ -566,7 +566,7 @@ struct battle_interface { int (*get_targeted_sub) (struct block_list *bl, va_list ap); int (*get_enemy_sub) (struct block_list *bl, va_list ap); int (*get_enemy_area_sub) (struct block_list *bl, va_list ap); - int (*delay_damage_sub) (int tid, unsigned int tick, int id, intptr_t data); + int (*delay_damage_sub) (int tid, int64 tick, int id, intptr_t data); int (*blewcount_bonus) (struct map_session_data *sd, uint16 skill_id); /* skill range criteria */ int (*range_type) (struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv); @@ -587,7 +587,7 @@ struct battle_interface { /* picks a random enemy within the specified range */ struct block_list* (*get_enemy_area) (struct block_list *src, int x, int y, int range, int type, int ignore_id); /* damages area, originally for royal guard's reflect damage */ - int (*damage_area) ( struct block_list *bl, va_list ap); + int (*damage_area) (struct block_list *bl, va_list ap); }; struct battle_interface *battle; -- cgit v1.2.3-60-g2f50