mirror of
https://github.com/Anime-Game-Servers/AGSLunarCore.git
synced 2024-11-23 04:19:48 +00:00
Fix teleporting to the wrong scene when leaving pure fiction
This commit is contained in:
parent
cd688dc5a0
commit
9300094362
@ -1,5 +1,6 @@
|
||||
package emu.lunarcore.game.challenge;
|
||||
|
||||
import emu.lunarcore.GameConstants;
|
||||
import emu.lunarcore.data.GameData;
|
||||
import emu.lunarcore.data.config.GroupInfo;
|
||||
import emu.lunarcore.data.config.MonsterInfo;
|
||||
@ -24,6 +25,9 @@ public class ChallengeEntityLoader extends SceneEntityLoader {
|
||||
// Setup first stage
|
||||
scene.loadGroup(instance.getExcel().getMazeGroupID1());
|
||||
|
||||
// Set leave entry
|
||||
scene.setLeaveEntryId(instance.isStory() ? GameConstants.CHALLENGE_STORY_ENTRANCE : GameConstants.CHALLENGE_ENTRANCE);
|
||||
|
||||
// Load all groups with props
|
||||
for (var group : scene.getFloorInfo().getGroups().values()) {
|
||||
// Skip non-server groups
|
||||
|
@ -27,6 +27,7 @@ import emu.lunarcore.util.Position;
|
||||
import it.unimi.dsi.fastutil.ints.*;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import us.hebi.quickbuf.RepeatedInt;
|
||||
|
||||
@Getter
|
||||
@ -38,6 +39,7 @@ public class Scene implements Tickable {
|
||||
private final int planeId;
|
||||
private final int floorId;
|
||||
private int entryId;
|
||||
@Setter private int leaveEntryId;
|
||||
|
||||
private int lastEntityId = 0;
|
||||
private boolean loaded = false;
|
||||
|
@ -19,10 +19,8 @@ public class HandlerLeaveChallengeCsReq extends PacketHandler {
|
||||
|
||||
// Get entry id
|
||||
int leaveEntryId = GameConstants.CHALLENGE_ENTRANCE;
|
||||
if (session.getPlayer().getChallengeInstance() != null) {
|
||||
if (session.getPlayer().getChallengeInstance().getExcel().isStory()) {
|
||||
leaveEntryId = GameConstants.CHALLENGE_STORY_ENTRANCE;
|
||||
}
|
||||
if (session.getPlayer().getScene().getLeaveEntryId() != 0) {
|
||||
leaveEntryId = session.getPlayer().getScene().getLeaveEntryId();
|
||||
}
|
||||
|
||||
// Leave scene
|
||||
|
Loading…
Reference in New Issue
Block a user