mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
refactor(zone): LWOSCENEID lives with the zone code, its layer is an eSceneType
LWOSCENEID and LWOSCENEID_INVALID move from dCommonVars.h to dZoneManager/LWOSCENEID.h; only the zone code uses them. The layer half is the scene's layer, now the new eSceneType (dCommon/dEnums) instead of a uint32_t: General (0), Audio (1, the *_audio.lvl scenes named "Audio") and FX (2, Nexus Tower's *_fxs.lvl scenes named "FXs"), the three layers the zone files of every client on disk use. ZoneScene's sceneType is an eSceneType too, so a scene's LWOSCENEID is built from it directly, and the dashboard compares against eSceneType::General instead of 0. The zone checksum still hashes the layer's number. Check in game: every world loads (the zone checksum the client checks is unchanged), Nexus Tower included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -701,7 +701,7 @@ std::optional<std::string> ZoneTerrainLayersJson(uint32_t zoneId) {
|
||||
const auto luz = ClientAssets::ReadResFile("maps/" + zone->luzPath);
|
||||
std::string error;
|
||||
if (const auto header = luz ? ZonePaths::ReadHeader(*luz, error) : std::nullopt) {
|
||||
for (const auto& scene : header->scenes) if (scene.sceneType == 0) names.try_emplace(scene.id, scene.name);
|
||||
for (const auto& scene : header->scenes) if (scene.sceneType == eSceneType::General) names.try_emplace(scene.id, scene.name);
|
||||
}
|
||||
std::map<uint8_t, uint64_t> cells;
|
||||
nlohmann::json chunks = nlohmann::json::array();
|
||||
|
||||
@@ -373,7 +373,7 @@ namespace {
|
||||
if (!lvl) continue;
|
||||
const auto objectsBefore = assetOf.size();
|
||||
const auto lighting = WorldScene::ReadLighting(*lvl);
|
||||
if (lighting && scene.sceneType == 0) lightingOf.try_emplace(scene.id, LightingJson(*lighting));
|
||||
if (lighting && scene.sceneType == eSceneType::General) lightingOf.try_emplace(scene.id, LightingJson(*lighting));
|
||||
if (sky < 0) {
|
||||
const auto skydome = JoinPath("", WorldScene::ReadSkydome(*lvl));
|
||||
if (skydome.ends_with(".nif") && Files().paths.contains(skydome)) sky = static_cast<int64_t>(scenery.IndexOf(skydome));
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace {
|
||||
size_t index = 0;
|
||||
for (const auto& scene : zoneFile->scenes) {
|
||||
// Audio scenes share their general scene's id; the general one names it
|
||||
if (scene.sceneType == 0 || !scenes.contains(std::to_string(scene.id))) scenes[std::to_string(scene.id)] = scene.name;
|
||||
if (scene.sceneType == eSceneType::General || !scenes.contains(std::to_string(scene.id))) scenes[std::to_string(scene.id)] = scene.name;
|
||||
const auto lvl = ClientAssets::ReadResFile("maps/" + folder + scene.filename);
|
||||
if (!lvl) continue;
|
||||
for (const auto& object : WorldScene::ReadObjects(*lvl)) {
|
||||
|
||||
Reference in New Issue
Block a user