mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
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>
38 lines
1.6 KiB
C++
38 lines
1.6 KiB
C++
#ifndef LWOSCENEID_H
|
|
#define LWOSCENEID_H
|
|
|
|
#include <cstdint>
|
|
|
|
#include "eSceneType.h"
|
|
|
|
// A scene of a zone: its scene ID and layer
|
|
struct LWOSCENEID {
|
|
public:
|
|
constexpr LWOSCENEID() noexcept { m_sceneID = -1; m_layerID = eSceneType::General; }
|
|
constexpr LWOSCENEID(int32_t sceneID) noexcept { m_sceneID = sceneID; m_layerID = eSceneType::General; }
|
|
constexpr LWOSCENEID(int32_t sceneID, eSceneType layerID) noexcept { m_sceneID = sceneID; m_layerID = layerID; }
|
|
|
|
constexpr LWOSCENEID& operator=(const LWOSCENEID& rhs) noexcept { m_sceneID = rhs.m_sceneID; m_layerID = rhs.m_layerID; return *this; }
|
|
constexpr LWOSCENEID& operator=(const int32_t rhs) noexcept { m_sceneID = rhs; m_layerID = eSceneType::General; return *this; }
|
|
|
|
constexpr bool operator<(const LWOSCENEID& rhs) const noexcept { return (m_sceneID < rhs.m_sceneID || (m_sceneID == rhs.m_sceneID && m_layerID < rhs.m_layerID)); }
|
|
constexpr bool operator<(const int32_t rhs) const noexcept { return m_sceneID < rhs; }
|
|
|
|
constexpr bool operator==(const LWOSCENEID& rhs) const noexcept { return (m_sceneID == rhs.m_sceneID && m_layerID == rhs.m_layerID); }
|
|
constexpr bool operator==(const int32_t rhs) const noexcept { return m_sceneID == rhs; }
|
|
|
|
constexpr int32_t GetSceneID() const noexcept { return m_sceneID; }
|
|
constexpr eSceneType GetLayerID() const noexcept { return m_layerID; }
|
|
|
|
constexpr void SetSceneID(const int32_t sceneID) noexcept { m_sceneID = sceneID; }
|
|
constexpr void SetLayerID(const eSceneType layerID) noexcept { m_layerID = layerID; }
|
|
|
|
private:
|
|
int32_t m_sceneID;
|
|
eSceneType m_layerID;
|
|
};
|
|
|
|
constexpr LWOSCENEID LWOSCENEID_INVALID = -1;
|
|
|
|
#endif //!LWOSCENEID_H
|