Browse Source

fixed bug with negative xp when setting level to 10

lakebane2
FatBoy-DOTC 3 weeks ago
parent
commit
5f56143c5e
  1. 10
      src/engine/InterestManagement/InterestManager.java
  2. 9
      src/engine/objects/PlayerCharacter.java

10
src/engine/InterestManagement/InterestManager.java

@ -19,10 +19,7 @@ import engine.net.AbstractNetMsg;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.LoadCharacterMsg; import engine.net.client.msg.*;
import engine.net.client.msg.LoadStructureMsg;
import engine.net.client.msg.MoveToPointMsg;
import engine.net.client.msg.UnloadObjectsMsg;
import engine.objects.*; import engine.objects.*;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -525,11 +522,6 @@ public enum InterestManager implements Runnable {
player.setDirtyLoad(true); player.setDirtyLoad(true);
updateStaticList(player, origin); updateStaticList(player, origin);
updateMobileList(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) { public synchronized void HandleLoadForTeleport(PlayerCharacter playerCharacter) {

9
src/engine/objects/PlayerCharacter.java

@ -4872,6 +4872,15 @@ public class PlayerCharacter extends AbstractCharacter {
this.timestamps.put("nextBoxCheck", System.currentTimeMillis() + 10000); 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)) { if(this.isBoxed && !this.containsEffect(1672601862)) {
PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false); PowersManager.applyPower(this, this, Vector3fImmutable.ZERO, 1672601862, 40, false);
} }

Loading…
Cancel
Save