From 3b4455299f3c5c0f6d6032c21c15f2e011639749 Mon Sep 17 00:00:00 2001 From: Lance Date: Sun, 28 May 2006 03:24:03 +0000 Subject: - Suppressed compilation warnings (unsigned and signed mismatches) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6793 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/battle.c | 2 +- src/map/mob.c | 2 +- src/map/pc.c | 7 ++++--- src/map/skill.c | 16 ++++++++-------- src/map/status.c | 8 ++++---- 5 files changed, 18 insertions(+), 17 deletions(-) (limited to 'src/map') diff --git a/src/map/battle.c b/src/map/battle.c index 20dab2f63..b0b953827 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2747,7 +2747,7 @@ void battle_drain(TBL_PC *sd, TBL_PC* tsd, int rdamage, int ldamage, int race, i if (rhp || rsp) status_zap(&tsd->bl, rhp, rsp); if (rand()%1000 < sd->sp_vanish_rate) - status_percent_damage(&sd->bl, &tsd->bl, 0, sd->sp_vanish_per); + status_percent_damage(&sd->bl, &tsd->bl, 0, (unsigned char)sd->sp_vanish_per); } } /*========================================== diff --git a/src/map/mob.c b/src/map/mob.c index 8b6b705dc..3c04a5ead 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1761,7 +1761,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) continue; temp++; - if(mvp_damagedmglog[temp].dmg){ + if(mvp_damage<(unsigned int)md->dmglog[temp].dmg){ third_sd = second_sd; second_sd = mvp_sd; mvp_sd=tmpsd[temp]; diff --git a/src/map/pc.c b/src/map/pc.c index e3a2dfdc1..64ee6b6e8 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -290,7 +290,7 @@ int pc_setrestartvalue(struct map_session_data *sd,int type) { status_heal(&sd->bl, b_status->hp, b_status->sp>status->sp?b_status->sp-status->sp:0, 1); } else { //Just for saving on the char-server sd->status.hp = b_status->hp; - if (sd->status.sp < b_status->sp) + if ((unsigned int)sd->status.sp < b_status->sp) sd->status.sp = b_status->sp; } /* removed exp penalty on spawn [Valaris] */ @@ -2888,6 +2888,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl) sd_status= status_get_status_data(&sd->bl); md_status= status_get_status_data(bl); + md = (TBL_MOB *)bl; if(md->state.steal_flag>=battle_config.skill_steal_max_tries || md_status->mode&MD_BOSS || md->master_id || (md->class_>=1324 && md->class_<1364) || // prevent stealing from treasure boxes [Valaris] @@ -4479,7 +4480,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) if(md->target_id==sd->bl.id) mob_unlocktarget(md,tick); if(battle_config.mobs_level_up && md->status.hp && - md->level < pc_maxbaselv(sd) && + (unsigned int)md->level < pc_maxbaselv(sd) && !md->guardian_data && !md->special_state.ai// Guardians/summons should not level. [Skotlex] ) { // monster level up [Valaris] clif_misceffect(&md->bl,0); @@ -6515,7 +6516,7 @@ static void pc_natural_heal_hp(struct map_session_data *sd) hp+= bonus; } while(sd->hp_sub >= battle_config.natural_healhp_interval); - if (status_heal(&sd->bl, hp, 0, 1) < hp) + if ((unsigned int)status_heal(&sd->bl, hp, 0, 1) < hp) { //At full. sd->inchealhptick = 0; return; diff --git a/src/map/skill.c b/src/map/skill.c index 7bd2f737d..7a53cf63c 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1848,7 +1848,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds case MO_TRIPLEATTACK: { int delay = 1000 - 4*sstatus->agi - 2*sstatus->dex; - if (damage < tstatus->hp && + if (damage < (signed int)tstatus->hp && pc_checkskill(sd, MO_CHAINCOMBO) > 0) delay += 300 * battle_config.combo_delay_rate / 100; sc_start4(src,SC_COMBO,100,MO_TRIPLEATTACK,skilllv,0,0,delay); @@ -1861,7 +1861,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds case MO_CHAINCOMBO: { int delay = 1000 - 4*sstatus->agi - 2*sstatus->dex; - if(damage < tstatus->hp && + if(damage < (signed int)tstatus->hp && (pc_checkskill(sd, MO_COMBOFINISH) > 0 && sd->spiritball > 0)) delay += 300 * battle_config.combo_delay_rate /100; sc_start4(src,SC_COMBO,100,MO_CHAINCOMBO,skilllv,0,0,delay); @@ -1871,7 +1871,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds case MO_COMBOFINISH: { int delay = 700 - 4*sstatus->agi - 2*sstatus->dex; - if(damage < tstatus->hp && + if(damage < (signed int)tstatus->hp && ( (pc_checkskill(sd, MO_EXTREMITYFIST) > 0 && sd->spiritball >= 4 && sd->sc.data[SC_EXPLOSIONSPIRITS].timer != -1) || (pc_checkskill(sd, CH_TIGERFIST) > 0 && sd->spiritball > 0) || @@ -1885,7 +1885,7 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds case CH_TIGERFIST: { //Tigerfist is now a combo-only skill. [Skotlex] int delay = 1000 - 4*sstatus->agi - 2*sstatus->dex; - if(damage < tstatus->hp && + if(damage < (signed int)tstatus->hp && ( (pc_checkskill(sd, MO_EXTREMITYFIST) > 0 && sd->spiritball >= 3 && sd->sc.data[SC_EXPLOSIONSPIRITS].timer != -1) || (pc_checkskill(sd, CH_CHAINCRUSH) > 0) @@ -1898,14 +1898,14 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds case CH_CHAINCRUSH: { int delay = 1000 - 4*sstatus->agi - 2*sstatus->dex; - if(damage < tstatus->hp) + if(damage < (signed int)tstatus->hp) delay += 300 * battle_config.combo_delay_rate /100; sc_start4(src,SC_COMBO,100,CH_CHAINCRUSH,skilllv,0,0,delay); clif_combo_delay(src,delay); break; } case AC_DOUBLE: - if((tstatus->race == RC_BRUTE || tstatus->race == RC_INSECT) && damage < tstatus->hp && pc_checkskill(sd, HT_POWER)) { + if((tstatus->race == RC_BRUTE || tstatus->race == RC_INSECT) && damage < (signed int)tstatus->hp && pc_checkskill(sd, HT_POWER)) { //TODO: This code was taken from Triple Blows,is this even how it should be? [Skotlex] sc_start4(src,SC_COMBO,100,HT_POWER,bl->id,0,0,2000); clif_combo_delay(src,2000); @@ -7967,11 +7967,11 @@ int skill_check_condition(struct map_session_data *sd,int skill, int lv, int typ } if(!(type&2)){ - if( hp>0 && status->hp <= hp) { /* HPチェック */ + if( hp>0 && status->hp <= (unsigned int)hp) { /* HPチェック */ clif_skill_fail(sd,skill,2,0); /* HP不足?F失敗通知 */ return 0; } - if( sp>0 && status->sp < sp) { /* SPチェック */ + if( sp>0 && status->sp < (unsigned int)sp) { /* SPチェック */ clif_skill_fail(sd,skill,1,0); /* SP不足?F失敗通知 */ return 0; } diff --git a/src/map/status.c b/src/map/status.c index a831bf51a..2c408b47b 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1663,7 +1663,7 @@ int status_calc_pc(struct map_session_data* sd,int first) if (!battle_config.weapon_defense_type && status->def > battle_config.max_def) { status->def2 += battle_config.over_def_bonus*(status->def -battle_config.max_def); - status->def = battle_config.max_def; + status->def = (unsigned char)battle_config.max_def; } // ----- INT-MDEF CALCULATION ----- @@ -1680,7 +1680,7 @@ int status_calc_pc(struct map_session_data* sd,int first) if (!battle_config.weapon_defense_type && status->mdef > battle_config.max_def) { status->mdef2 += battle_config.over_def_bonus*(status->mdef -battle_config.max_def); - status->mdef = battle_config.max_def; + status->mdef = (unsigned char)battle_config.max_def; } // ----- WALKING SPEED CALCULATION ----- @@ -1962,7 +1962,7 @@ void status_calc_bl_sub_pc(struct map_session_data *sd, unsigned long flag) if(battle_config.hp_rate != 100) status->max_hp = status->max_hp * battle_config.hp_rate/100; - if(status->max_hp > battle_config.max_hp) + if(status->max_hp > (unsigned int)battle_config.max_hp) status->max_hp = battle_config.max_hp; else if(!status->max_hp) status->max_hp = 1; @@ -2014,7 +2014,7 @@ void status_calc_bl_sub_pc(struct map_session_data *sd, unsigned long flag) if(battle_config.sp_rate != 100) status->max_sp = status->max_sp * battle_config.sp_rate/100; - if(status->max_sp > battle_config.max_sp) + if(status->max_sp > (unsigned int)battle_config.max_sp) status->max_sp = battle_config.max_sp; else if(!status->max_sp) status->max_sp = 1; -- cgit v1.2.3-60-g2f50