Addition of player fame and raidpoint limit checks.

This commit is contained in:
MobiusDevelopment
2021-09-30 06:21:07 +00:00
parent a58c0345d3
commit 699ef110ed
21 changed files with 501 additions and 80 deletions

View File

@@ -2255,8 +2255,19 @@ public class PlayerInstance extends Playable
*/
public void setFame(int fame)
{
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this);
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : fame;
int newFame = fame;
if (fame > Config.MAX_PERSONAL_FAME_POINTS)
{
newFame = Config.MAX_PERSONAL_FAME_POINTS;
}
else if (fame < 0)
{
newFame = 0;
}
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, newFame), this);
_fame = newFame;
}
/**