fixed bug with negative xp when setting level to 10
This commit is contained in:
@@ -19,10 +19,7 @@ import engine.net.AbstractNetMsg;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.LoadCharacterMsg;
|
||||
import engine.net.client.msg.LoadStructureMsg;
|
||||
import engine.net.client.msg.MoveToPointMsg;
|
||||
import engine.net.client.msg.UnloadObjectsMsg;
|
||||
import engine.net.client.msg.*;
|
||||
import engine.objects.*;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -525,11 +522,6 @@ public enum InterestManager implements Runnable {
|
||||
player.setDirtyLoad(true);
|
||||
updateStaticList(player, origin);
|
||||
updateMobileList(player, origin);
|
||||
if(player.level < 10) {
|
||||
player.setLevel((short) 10);
|
||||
player.getCharItemManager().addGoldToInventory(1000,false);
|
||||
player.getCharItemManager().addItemToInventory(new MobLoot(player,ItemBase.getItemBase(980066),1,false).promoteToItem(player));
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void HandleLoadForTeleport(PlayerCharacter playerCharacter) {
|
||||
|
||||
@@ -4872,6 +4872,15 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
this.timestamps.put("nextBoxCheck", System.currentTimeMillis() + 10000);
|
||||
}
|
||||
|
||||
if(this.level < 10) {
|
||||
this.setLevel((short) 10);
|
||||
this.getCharItemManager().addGoldToInventory(1000,false);
|
||||
this.getCharItemManager().addItemToInventory(new MobLoot(this,ItemBase.getItemBase(980066),1,false).promoteToItem(this));
|
||||
this.setOverFlowEXP(0);
|
||||
TargetedActionMsg cmm = new TargetedActionMsg(this);
|
||||
DispatchMessage.dispatchMsgToInterestArea(this, cmm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||
}
|
||||
|
||||
if(this.isBoxed && !this.containsEffect(1672601862)) {
|
||||
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user