From c6baa02f18075da2abffe532ce0c87483c36ad9d Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Sat, 11 Apr 2020 08:38:27 +0200 Subject: Fix usage of *= operator --- src/map/map.c | 8 ++++---- src/map/mob.c | 4 ++-- src/map/pc.c | 4 ++-- src/map/pet.c | 4 ++-- src/map/skill.c | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/map/map.c b/src/map/map.c index b2c9c77c3..40e66e4df 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1713,9 +1713,9 @@ static bool map_closest_freecell(int16 m, const struct block_list *bl, int16 *x, tx = *x + dx; ty = *y + dy; if (unit_is_dir_or_opposite(dir, UNIT_DIR_SOUTHWEST)) - tx *= costrange / MOVE_COST; + tx = tx * costrange / MOVE_COST; if (unit_is_dir_or_opposite(dir, UNIT_DIR_NORTHWEST)) - ty *= costrange / MOVE_COST; + ty = ty * costrange / MOVE_COST; if (!map->count_oncell(m, tx, ty, type, flag) && map->getcell(m, bl, tx, ty, CELL_CHKPASS)) { *x = tx; *y = ty; @@ -1724,9 +1724,9 @@ static bool map_closest_freecell(int16 m, const struct block_list *bl, int16 *x, tx = *x + dx; ty = *y + dy; if (unit_is_dir_or_opposite(dir, UNIT_DIR_NORTHWEST)) - tx *= costrange / MOVE_COST; + tx = tx * costrange / MOVE_COST; if (unit_is_dir_or_opposite(dir, UNIT_DIR_SOUTHWEST)) - ty *= costrange / MOVE_COST; + ty = ty * costrange / MOVE_COST; if (!map->count_oncell(m, tx, ty, type, flag) && map->getcell(m, bl, tx, ty, CELL_CHKPASS)) { *x = tx; *y = ty; diff --git a/src/map/mob.c b/src/map/mob.c index 51a32abd9..07732b996 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3907,8 +3907,8 @@ static int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 } } - mob_skills[i].permillage *= battle_config.mob_skill_rate / 100; - mob_skills[i].delay *= battle_config.mob_skill_delay / 100; + mob_skills[i].permillage = mob_skills[i].permillage * battle_config.mob_skill_rate / 100; + mob_skills[i].delay = mob_skills[i].delay * battle_config.mob_skill_delay / 100; db->maxskill = ++i; } diff --git a/src/map/pc.c b/src/map/pc.c index 90282209b..d21a31313 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -8325,7 +8325,7 @@ static int pc_dead(struct map_session_data *sd, struct block_list *src) base_penalty *= 2; if (sd->status.mod_death != 100) - base_penalty *= sd->status.mod_death / 100; + base_penalty = base_penalty * sd->status.mod_death / 100; sd->status.base_exp -= min(sd->status.base_exp, base_penalty); clif->updatestatus(sd, SP_BASEEXP); @@ -8350,7 +8350,7 @@ static int pc_dead(struct map_session_data *sd, struct block_list *src) job_penalty *= 2; if (sd->status.mod_death != 100) - job_penalty *= sd->status.mod_death / 100; + job_penalty = job_penalty * sd->status.mod_death / 100; sd->status.job_exp -= min(sd->status.job_exp, job_penalty); clif->updatestatus(sd, SP_JOBEXP); diff --git a/src/map/pet.c b/src/map/pet.c index 620779765..83946953d 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -323,7 +323,7 @@ static int pet_hungry(int tid, int64 tick, int id, intptr_t data) } clif->send_petdata(sd, pd, 2, pd->pet.hungry); - interval *= battle_config.pet_hungry_delay_rate / 100; + interval = interval * battle_config.pet_hungry_delay_rate / 100; pd->pet_hungry_timer = timer->add(tick + max(interval, 1), pet->hungry, sd->bl.id, 0); return 0; @@ -944,7 +944,7 @@ static int pet_food(struct map_session_data *sd, struct pet_data *pd) else intimacy += pd->petDB->r_hungry / 2; // Increase intimacy by 50% of FeedIncrement. - intimacy *= battle_config.pet_friendly_rate / 100; + intimacy = intimacy * battle_config.pet_friendly_rate / 100; pet->set_intimate(pd, pd->pet.intimate + intimacy); if (pd->pet.intimate == PET_INTIMACY_NONE) { diff --git a/src/map/skill.c b/src/map/skill.c index 3dccf7a9e..d7ad922c8 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -7383,7 +7383,7 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list * int rate = 100 * (100 - (tstatus->int_ / 2 + tstatus->vit / 3 + tstatus->luk / 10)); int duration = skill->get_time2(skill_id, skill_lv); - duration *= (100 - (tstatus->int_ + tstatus->vit) / 2) / 100; + duration = duration * (100 - (tstatus->int_ + tstatus->vit) / 2) / 100; status->change_start(src, bl, SC_BLIND, rate, 1, 0, 0, 0, duration, SCFLAG_NONE); } -- cgit v1.2.3-70-g09d2