refactor: implicit cast from double to float may be lossy

This commit is contained in:
Breno A. 2024-06-09 09:38:33 -03:00
parent d5ad077ce1
commit 6e3b3b20a0
2 changed files with 12 additions and 12 deletions

View File

@ -475,7 +475,7 @@ public class StaminaManager extends BasePlayerManager {
if (consumption.amount < 0 && isCharacterStamina) {
// Do not apply reduction factor when recovering stamina
if (player.getTeamManager().getTeamResonances().contains(10301)) {
consumption.amount *= 0.85f;
consumption.amount *= (int) 0.85f;
}
}
// Delay 1 seconds before starts recovering stamina
@ -543,8 +543,8 @@ public class StaminaManager extends BasePlayerManager {
consumption.amount = ConsumptionType.CLIMBING.amount;
}
// Climbing specific reductions
consumption.amount *= getFoodCostReductionFactor(ClimbFoodReductionMap);
consumption.amount *= getTalentCostReductionFactor(ClimbTalentReductionMap);
consumption.amount *= (int) getFoodCostReductionFactor(ClimbFoodReductionMap);
consumption.amount *= (int) getTalentCostReductionFactor(ClimbTalentReductionMap);
return consumption;
}
@ -560,8 +560,8 @@ public class StaminaManager extends BasePlayerManager {
consumption.amount = ConsumptionType.SWIM_DASH.amount;
}
// Swimming specific reductions
consumption.amount *= getFoodCostReductionFactor(SwimFoodReductionMap);
consumption.amount *= getTalentCostReductionFactor(SwimTalentReductionMap);
consumption.amount *= (int) getFoodCostReductionFactor(SwimFoodReductionMap);
consumption.amount *= (int) getTalentCostReductionFactor(SwimTalentReductionMap);
return consumption;
}
@ -571,7 +571,7 @@ public class StaminaManager extends BasePlayerManager {
consumption.type = ConsumptionType.DASH;
consumption.amount = ConsumptionType.DASH.amount;
// Dashing specific reductions
consumption.amount *= getFoodCostReductionFactor(DashFoodReductionMap);
consumption.amount *= (int) getFoodCostReductionFactor(DashFoodReductionMap);
}
return consumption;
}
@ -583,8 +583,8 @@ public class StaminaManager extends BasePlayerManager {
}
Consumption consumption = new Consumption(ConsumptionType.FLY);
// Flying specific reductions
consumption.amount *= getFoodCostReductionFactor(FlyFoodReductionMap);
consumption.amount *= getTalentCostReductionFactor(FlyTalentReductionMap);
consumption.amount *= (int) getFoodCostReductionFactor(FlyFoodReductionMap);
consumption.amount *= (int) getTalentCostReductionFactor(FlyTalentReductionMap);
return consumption;
}

View File

@ -143,8 +143,8 @@ public class Position implements Serializable {
/** In radians */
public Position translate(float dist, float angle) {
this.x += dist * Math.sin(angle);
this.y += dist * Math.cos(angle);
this.x += (float) (dist * Math.sin(angle));
this.y += (float) (dist * Math.cos(angle));
return this;
}
@ -173,8 +173,8 @@ public class Position implements Serializable {
public Position translateWithDegrees(float dist, float angle) {
angle = (float) Math.toRadians(angle);
this.x += dist * Math.sin(angle);
this.y += -dist * Math.cos(angle);
this.x += (float) (dist * Math.sin(angle));
this.y += (float) (-dist * Math.cos(angle));
return this;
}