I was told to do this:
Code:
public boolean addSkillXP(int amount, int skill) {
int oldLevel = getLevelForXP(playerXP[skill]);
playerXP[skill] += amount;
if (oldLevel < getLevelForXP(playerXP[skill])) {
animation(199, absY, absX);
playerLevel[skill] = getLevelForXP(playerXP[skill]);
updateRequired = true;
appearanceUpdateRequired = true;
levelup(skill);
setSkillLevel(skill, playerLevel[skill], playerXP[skill]);
}
refreshSkills();
if (skill == 2) {
CalculateMaxHit();
}
return true;
}
Now underneath public boolean addSkillXP(int amount, int skill) {
Add this:
Code:
if (expLock) {
return;
}
So it is at the top of the method.
Now mine looks like this:
Code:
public boolean addSkillXP(int amount, int skill){
if (expLock); {
return;
}
if (amount+c.playerXP[skill] < 0 || c.playerXP[skill] > 200000000) {
if(c.playerXP[skill] > 200000000) {
c.playerXP[skill] = 200000000;
}
return false;
}
And when I compile it I get these 2 errors,
Code:
src\server\model\players\PlayerAssistant.java:1972: cannot find symbol
symbol : variable expLock
location: class server.model.players.PlayerAssistant
if (expLock); {
^
src\server\model\players\PlayerAssistant.java:1973: missing return value
return;
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
Press any key to continue . . .
This is exactly what the tutorial said to copy and paste into player.java and it compiled fine, so I don't see how it isn't recognizing it.
Code:
}
public boolean expLock;
}
^ I don't understand why this was in the tutorial and it excludes returning to a value, doesn't it have to return to a true or false value? When I try to make it return I get errors.