Fix small issues

This commit is contained in:
NotThorny
2023-01-27 22:24:19 -07:00
parent 4c82a0184e
commit eef1759d99
4 changed files with 13 additions and 4 deletions

View File

@@ -85,7 +85,7 @@ public class GameHome {
player.getSession().send(new PacketHomeAllUnlockedBgmIdListNotify(player));
}
// Let the game know the reward is claimed
// Tell the client the reward is claimed or realm unlocked
public void onClaimReward(Player player){
player.getSession().send(new PacketPlayerHomeCompInfoNotify(player));
}

View File

@@ -393,7 +393,8 @@ public class Player {
// Tell the client the realm is unlocked
if(realmId > 3){ // Realms 3 and below are default 'unlocked'
this.sendPacket(new PacketHomeModuleUnlockNotify(realmId)); // Update needs scene change?
this.sendPacket(new PacketHomeModuleUnlockNotify(realmId));
this.getHome().onClaimReward(this);
}
}

View File

@@ -15,6 +15,13 @@ public class HandlerBackMyWorldReq extends PacketHandler {
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
Scene scene = session.getPlayer().getScene();
int prevScene = scene.getPrevScene();
// Sanity check for switching between teapot realms
if(prevScene >= 2000 && prevScene <= 2006){
prevScene = 3;
}
session.getPlayer().getWorld().transferPlayerToScene(
session.getPlayer(),
scene.getPrevScene(),

View File

@@ -44,9 +44,10 @@ public class PacketPlayerEnterSceneNotify extends BasePacket {
super(PacketOpcodes.PlayerEnterSceneNotify);
// Set previous position
if(newScene != 3){ // Hardcoded for now else you always return to beach
// TODO: Don't update position within same scene
if(!(newScene == 3)){ // Hardcoded for now else weird positions will occur
// Don't update position within same scene or teapot
}else{
// Only used for exiting teapot currently
player.setPrevPos(player.getPosition());
}