mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-16 15:24:44 +01:00
Fix avatar hp not being set properly after a battle
This commit is contained in:
@@ -222,7 +222,7 @@ public class BattleService extends BaseGameService {
|
|||||||
if (avatar == null) continue;
|
if (avatar == null) continue;
|
||||||
|
|
||||||
AvatarProperty prop = battleAvatar.getAvatarStatus();
|
AvatarProperty prop = battleAvatar.getAvatarStatus();
|
||||||
int currentHp = (int) Math.round((prop.getLeftHp() / prop.getMaxHp()) * 100);
|
int currentHp = (int) Math.round((prop.getLeftHp() / prop.getMaxHp()) * 10000);
|
||||||
int currentSp = (int) prop.getLeftSp() * 100;
|
int currentSp = (int) prop.getLeftSp() * 100;
|
||||||
|
|
||||||
avatar.setCurrentHp(Math.max(currentHp, minimumHp));
|
avatar.setCurrentHp(Math.max(currentHp, minimumHp));
|
||||||
|
|||||||
Reference in New Issue
Block a user