Prevent vitality points exceeding max value.
This commit is contained in:
@@ -460,14 +460,14 @@ public class PcStat extends PlayableStat
|
||||
{
|
||||
if (getActiveChar().isSubClassActive())
|
||||
{
|
||||
return getActiveChar().getSubClasses().get(getActiveChar().getClassIndex()).getVitalityPoints();
|
||||
return Math.min(MAX_VITALITY_POINTS, getActiveChar().getSubClasses().get(getActiveChar().getClassIndex()).getVitalityPoints());
|
||||
}
|
||||
return _vitalityPoints;
|
||||
return Math.min(MAX_VITALITY_POINTS, _vitalityPoints);
|
||||
}
|
||||
|
||||
public int getBaseVitalityPoints()
|
||||
{
|
||||
return _vitalityPoints;
|
||||
return Math.min(MAX_VITALITY_POINTS, _vitalityPoints);
|
||||
}
|
||||
|
||||
public double getVitalityExpBonus()
|
||||
@@ -479,10 +479,10 @@ public class PcStat extends PlayableStat
|
||||
{
|
||||
if (getActiveChar().isSubClassActive())
|
||||
{
|
||||
getActiveChar().getSubClasses().get(getActiveChar().getClassIndex()).setVitalityPoints(value);
|
||||
getActiveChar().getSubClasses().get(getActiveChar().getClassIndex()).setVitalityPoints(Math.min(MAX_VITALITY_POINTS, value));
|
||||
return;
|
||||
}
|
||||
_vitalityPoints = value;
|
||||
_vitalityPoints = Math.min(MAX_VITALITY_POINTS, value);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user