Fixed some LGTM warnings (#6767)
Co-authored-by: aleos <aleos89@users.noreply.github.com>
This commit is contained in:
@@ -18457,7 +18457,7 @@ int skill_castfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
|
||||
if (battle_config.cast_rate != 100)
|
||||
time = time * battle_config.cast_rate / 100;
|
||||
// return final cast time
|
||||
time = max(time, 0);
|
||||
time = max((int)time, 0);
|
||||
//ShowInfo("Castime castfix = %f\n",time);
|
||||
|
||||
return (int)time;
|
||||
@@ -18643,7 +18643,7 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16
|
||||
time = time * (1 - sqrt(((float)(status_get_dex(bl) * 2 + status_get_int(bl)) / battle_config.vcast_stat_scale)));
|
||||
|
||||
time = time * (1 - (float)min(reduce_cast_rate, 100) / 100);
|
||||
time = max(time, 0) + (1 - (float)min(fixcast_r, 100) / 100) * max(fixed, 0); //Underflow checking/capping
|
||||
time = max((int)time, 0) + (1 - (float)min(fixcast_r, 100) / 100) * max(fixed, 0); //Underflow checking/capping
|
||||
|
||||
return (int)time;
|
||||
}
|
||||
@@ -20326,8 +20326,8 @@ int skill_delunitgroup_(std::shared_ptr<s_skill_unit_group> group, const char* f
|
||||
|
||||
// remove all unit cells
|
||||
if(group->unit != NULL)
|
||||
for( i = 0; i < group->unit_count; i++ )
|
||||
skill_delunit(&group->unit[i]);
|
||||
for( int j = 0; j < group->unit_count; j++ )
|
||||
skill_delunit(&group->unit[j]);
|
||||
|
||||
// clear Talkie-box string
|
||||
if( group->valstr != NULL ) {
|
||||
@@ -22236,7 +22236,7 @@ int skill_blockpc_start(struct map_session_data *sd, int skill_id, t_tick tick)
|
||||
sd->scd[i]->skill_id = skill_id;
|
||||
sd->scd[i]->timer = add_timer(gettick() + tick, skill_blockpc_end, sd->bl.id, i);
|
||||
|
||||
if (battle_config.display_status_timers && tick > 0)
|
||||
if (battle_config.display_status_timers)
|
||||
clif_skill_cooldown(sd, skill_id, tick);
|
||||
|
||||
return 1;
|
||||
@@ -24383,7 +24383,7 @@ static bool skill_parse_row_changematerialdb(char* split[], int columns, int cur
|
||||
}
|
||||
|
||||
// Clear previous data, for importing support
|
||||
if (id < ARRAYLENGTH(skill_changematerial_db) && skill_changematerial_db[id].nameid > 0) {
|
||||
if (skill_changematerial_db[id].nameid > 0) {
|
||||
found = true;
|
||||
memset(&skill_changematerial_db[id], 0, sizeof(skill_changematerial_db[id]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user