package gameserver import ( "gac-hkrpg-go/internal/common" "testing" ) func TestSceneOfEntryForTeleportKeepsRequestedFloorWhenPointIsExternal(t *testing.T) { res := &common.JsonConfig{LevelOutputConfigs: map[uint32]map[string]*common.LevelOutputConfig{ 1: { "P1_F10": {Scenes: map[uint32]common.SceneData{1: {Teleports: map[uint32]common.TeleportInfo{7: {}}}}}, "P1_F20": {Scenes: map[uint32]common.SceneData{}}, }, }} name, _, ok := sceneOfEntryForTeleport(res, 1, 20, 7) if !ok || name != "P1_F20" { t.Fatalf("requested floor lost: %q, %t", name, ok) } name, _, ok = sceneOfEntryForTeleport(res, 1, 0, 7) if !ok || name != "P1_F10" { t.Fatalf("floor-less lookup failed: %q, %t", name, ok) } }