From 04139592739a69aafe6cffb0ec52f65d50efb1fa Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 22 Aug 2013 17:49:11 -0300 Subject: Fixed MSVC warnings on 7f9f6e1b84061a7d393debf37395c8b4a2667db1 Special Thanks to KeiKun for bringing them to me. Signed-off-by: shennetsind --- src/map/clif.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 2ab379e31..847c426e5 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -4380,7 +4380,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) { //Modifies the type of damage according to status changes [Skotlex] //Aegis data specifies that: 4 endure against single hit sources, 9 against multi-hit. -static inline int clif_calc_delay(int type, int div, int64 damage, int delay) +static inline int clif_calc_delay(int type, int div, int damage, int delay) { return ( delay == 0 && damage > 0 ) ? ( div > 1 ? 9 : 4 ) : type; } @@ -4388,7 +4388,7 @@ static inline int clif_calc_delay(int type, int div, int64 damage, int delay) /*========================================== * Estimates walk delay based on the damage criteria. [Skotlex] *------------------------------------------*/ -int clif_calc_walkdelay(struct block_list *bl,int delay, int type, int64 damage, int div_) { +int clif_calc_walkdelay(struct block_list *bl,int delay, int type, int damage, int div_) { if (type == 4 || type == 9 || damage <=0) return 0; @@ -4423,10 +4423,11 @@ int clif_calc_walkdelay(struct block_list *bl,int delay, int type, int64 damage, /// 10 = critical hit /// 11 = lucky dodge /// 12 = (touch skill?) -int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tick, int sdelay, int ddelay, int64 damage, int div, int type, int64 damage2) +int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tick, int sdelay, int ddelay, int64 in_damage, int div, int type, int64 in_damage2) { unsigned char buf[33]; struct status_change *sc; + int damage,damage2; #if PACKETVER < 20071113 const int cmd = 0x8a; #else @@ -4436,8 +4437,9 @@ int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tic nullpo_ret(src); nullpo_ret(dst); - damage = cap_value(damage,INT_MIN,INT_MAX); - damage2 = cap_value(damage2,INT_MIN,INT_MAX); + damage = (int)cap_value(in_damage,INT_MIN,INT_MAX); + damage2 = (int)cap_value(in_damage2,INT_MIN,INT_MAX); + type = clif_calc_delay(type,div,damage+damage2,ddelay); sc = iStatus->get_sc(dst); if(sc && sc->count) { @@ -5108,15 +5110,16 @@ void clif_skill_cooldown(struct map_session_data *sd, uint16 skill_id, unsigned /// Skill attack effect and damage. /// 0114 .W .L .L .L .L .L .W .W
.W .B (ZC_NOTIFY_SKILL) /// 01de .W .L .L .L .L .L .L .W
.W .B (ZC_NOTIFY_SKILL2) -int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int tick,int sdelay,int ddelay,int64 damage,int div,uint16 skill_id,uint16 skill_lv,int type) +int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int tick,int sdelay,int ddelay,int64 in_damage,int div,uint16 skill_id,uint16 skill_lv,int type) { unsigned char buf[64]; struct status_change *sc; + int damage; nullpo_ret(src); nullpo_ret(dst); - damage = cap_value(damage,INT_MIN,INT_MAX); + damage = (int)cap_value(in_damage,INT_MIN,INT_MAX); type = clif_calc_delay(type,div,damage,ddelay); sc = iStatus->get_sc(dst); if(sc && sc->count) { -- cgit v1.2.3-70-g09d2