mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-06 21:03:44 +00:00
fix(zone): a scene transition links the scenes of its first and last points
Scene transitions of versions 34-38 have five points. The client links the scenes of the first and the last one (ZoneLoader::ReadZoneFile, 1.10.64: points[0] and points[count - 1], for every version); the scene graph used the first two, so in those zones it linked a scene with the one of the transition's second point instead. Of the 130 five-point transitions on disk, six (all in one older client zone) have a different scene at the second and last points; the rest link the same scenes as before. Live zones are unchanged. Check in game: nothing to check (no live zone changes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -58,9 +58,11 @@ namespace ZoneScenes {
|
||||
};
|
||||
for (const auto& transition : transitions) {
|
||||
if (transition.points.size() < 2) continue;
|
||||
// The low half of a point's LWOSCENEID is the scene, the high half its layer
|
||||
const auto a = static_cast<uint32_t>(transition.points[0].sceneID & 0xFFFFFFFF);
|
||||
const auto b = static_cast<uint32_t>(transition.points[1].sceneID & 0xFFFFFFFF);
|
||||
// A transition links the scenes of its first and last points (ZoneLoader::ReadZoneFile; 5-point transitions
|
||||
// of versions 34-38 have 3 more between them). The low half of a point's LWOSCENEID is the scene, the high
|
||||
// half its layer
|
||||
const auto a = static_cast<uint32_t>(transition.points.front().sceneID & 0xFFFFFFFF);
|
||||
const auto b = static_cast<uint32_t>(transition.points.back().sceneID & 0xFFFFFFFF);
|
||||
if (a == b || !m_Scenes.contains(a) || !m_Scenes.contains(b)) continue;
|
||||
link(a, b);
|
||||
link(b, a);
|
||||
|
||||
@@ -63,6 +63,15 @@ TEST(ZoneScenesTests, LoadsTheConnectedScenes) {
|
||||
EXPECT_TRUE(graph.Neighbours(9).empty());
|
||||
}
|
||||
|
||||
// A 5-point transition (versions 34-38) links its first and last points' scenes
|
||||
TEST(ZoneScenesTests, FivePointTransitionsLinkTheirEnds) {
|
||||
SceneTransition transition;
|
||||
for (const uint64_t scene : { 1, 2, 2, 2, 3 }) transition.points.push_back({ scene, {} });
|
||||
const ZoneScenes::SceneGraph graph(Scenes({ 0, 1, 2, 3 }), { transition });
|
||||
EXPECT_EQ(graph.Neighbours(1), (std::set<uint32_t>{ 3 }));
|
||||
EXPECT_TRUE(graph.Neighbours(2).empty());
|
||||
}
|
||||
|
||||
TEST(ZoneScenesTests, AddsTheScenesAroundThePlayerWhileTheReferenceIsOverridden) {
|
||||
const ZoneScenes::SceneGraph graph(Scenes({ 0, 1, 2, 3, 4 }), { Transition(1, 2), Transition(3, 4) });
|
||||
// Not overridden: only the reference point's scenes, wherever the player is
|
||||
|
||||
Reference in New Issue
Block a user