Replace the bitshift optimizations for multiplication (#7590)

* These were originally bitshifts because it was 'faster', but now with modern compilers and hardware, the only thing it does now is confuse developers who have to read the code
This commit is contained in:
Vincent Stumpf
2023-02-08 16:00:11 -08:00
committed by GitHub
parent 7313495185
commit 6938722f02
7 changed files with 71 additions and 69 deletions

View File

@@ -10389,7 +10389,7 @@ int pc_itemheal(map_session_data *sd, t_itemid itemid, int hp, int sp)
int bonus, tmp, penalty = 0;
if (hp) {
bonus = 100 + (sd->battle_status.vit << 1) + pc_checkskill(sd, SM_RECOVERY) * 10 + pc_checkskill(sd, AM_LEARNINGPOTION) * 5;
bonus = 100 + (sd->battle_status.vit * 2) + pc_checkskill(sd, SM_RECOVERY) * 10 + pc_checkskill(sd, AM_LEARNINGPOTION) * 5;
// A potion produced by an Alchemist in the Fame Top 10 gets +50% effect [DracoRPG]
if (potion_flag == 2) {
bonus += bonus * 50 / 100;
@@ -10425,7 +10425,7 @@ int pc_itemheal(map_session_data *sd, t_itemid itemid, int hp, int sp)
hp = tmp;
}
if (sp) {
bonus = 100 + (sd->battle_status.int_ << 1) + pc_checkskill(sd, MG_SRECOVERY) * 10 + pc_checkskill(sd, AM_LEARNINGPOTION) * 5;
bonus = 100 + (sd->battle_status.int_ * 2) + pc_checkskill(sd, MG_SRECOVERY) * 10 + pc_checkskill(sd, AM_LEARNINGPOTION) * 5;
// A potion produced by an Alchemist in the Fame Top 10 gets +50% effect [DracoRPG]
if (potion_flag == 2)
bonus += bonus * 50 / 100;