diff options
author | Fedja Beader <fedja@protonmail.ch> | 2025-02-17 23:57:54 +0100 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2025-02-18 00:03:58 +0100 |
commit | 6846a1375eae3836248b78cfb76bfc5f23db702b (patch) | |
tree | ccd8e1e0cef805fc8128c343abd42d545611d7ff | |
parent | 9e61976289ac3aba1623999c33e7688ea429490c (diff) | |
download | tmwa-skill_power_syntax.tar.gz tmwa-skill_power_syntax.tar.bz2 tmwa-skill_power_syntax.tar.xz tmwa-skill_power_syntax.zip |
Align variable names with their meaning + move past C89 standard for skill_power()skill_power_syntax
C89 mandates declarations to be at the top of function scope.
-rw-r--r-- | src/map/skill-pools.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/map/skill-pools.cpp b/src/map/skill-pools.cpp index ddec824..21e90ba 100644 --- a/src/map/skill-pools.cpp +++ b/src/map/skill-pools.cpp @@ -116,23 +116,19 @@ SP skill_stat(SkillID skill_id) int skill_power(dumb_ptr<map_session_data> sd, SkillID skill_id) { SP stat = skill_stat(skill_id); - int stat_value, skill_value; - int result; if (stat == SP::ZERO || !skill_pool_is_activated(sd, skill_id)) return 0; - stat_value = battle_get_stat(stat, sd); - skill_value = sd->status.skill[skill_id].lv; + int stat_value = battle_get_stat(stat, sd); + int skill_level = sd->status.skill[skill_id].lv; - if ((skill_value * 10) - 1 > stat_value) - skill_value += (stat_value / 10); + if ((skill_level * 10) - 1 > stat_value) + skill_level += (stat_value / 10); else - skill_value *= 2; + skill_level *= 2; - result = (skill_value * stat_value) / 10; - - return result; + return (skill_level * stat_value) / 10; } int skill_power_bl(dumb_ptr<block_list> bl, SkillID skill) |