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
@@ -2328,13 +2328,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2351,7 +2362,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2334,13 +2334,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2357,7 +2368,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2336,13 +2336,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2359,7 +2370,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2344,13 +2344,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2367,7 +2378,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2340,13 +2340,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2363,7 +2374,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2340,13 +2340,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2363,7 +2374,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2340,13 +2340,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2363,7 +2374,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2276,13 +2276,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2299,7 +2310,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2306,13 +2306,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2329,7 +2340,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2323,13 +2323,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2346,7 +2357,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2344,8 +2344,19 @@ public class PlayerInstance extends Playable
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2255,8 +2255,19 @@ public class PlayerInstance extends Playable
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2300,13 +2300,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2323,7 +2334,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2300,13 +2300,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2323,7 +2334,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2298,13 +2298,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2321,7 +2332,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2309,13 +2309,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2332,7 +2343,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2309,13 +2309,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2332,7 +2343,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2235,13 +2235,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2258,7 +2269,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2297,13 +2297,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2320,7 +2331,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2304,13 +2304,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2327,7 +2338,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**
@@ -2335,13 +2335,24 @@ public class PlayerInstance extends Playable
} }
/** /**
* Set the Fame of this NcInstane * Set the Fame of this PlayerInstane
* @param fame * @param fame
*/ */
public void setFame(int fame) public void setFame(int fame)
{ {
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerFameChanged(this, _fame, fame), this); int newFame = fame;
_fame = (fame > Config.MAX_PERSONAL_FAME_POINTS) ? Config.MAX_PERSONAL_FAME_POINTS : 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;
} }
/** /**
@@ -2358,7 +2369,17 @@ public class PlayerInstance extends Playable
*/ */
public void setRaidbossPoints(int points) public void setRaidbossPoints(int points)
{ {
_raidbossPoints = points; int value = points;
if (points > 2000000000) // Close to integer max value (2147483647).
{
value = 2000000000;
}
else if (points < 0)
{
value = 0;
}
_raidbossPoints = value;
} }
/** /**