mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-25 06:02:49 +00:00
feat(zone): read the zone boundary lines of .luz files
Between the scenes and the terrain file's name a zone file has its boundary lines: a u8 count, then per line a normal, a point, the destination zone, the destination scene ID and a spawn location. The reader took that spot for a u8-length "zone path" string, which is the same bytes only when there are no boundaries; a zone with boundaries would have misread everything after it. The destination is one u32 in the client (LuzReader::ReadZoneBoundaryLines, 0x01018490 in 1.10.64: map ID in bits 0-15, instance ID in bits 16-31, clone 0), read here as two u16s into an LWOZONEID with clone 0. The boundaries are kept on ZoneFile::zoneBoundaries. No zone of the 1.10.64 client (or any other client on disk) has boundary lines, so what is read from them is unchanged. Check in game: every world loads and zone transfers (launch pads, rockets, portals) work as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,15 @@ struct ZoneScene {
|
||||
uint8_t color_b{};
|
||||
};
|
||||
|
||||
// A line the player crosses to leave the zone (the client's LuzReader::ReadZoneBoundaryLines)
|
||||
struct ZoneBoundary {
|
||||
NiPoint3 normal;
|
||||
NiPoint3 point;
|
||||
LWOZONEID destZoneID; // clone 0
|
||||
uint32_t destSceneID{};
|
||||
NiPoint3 spawnLocation;
|
||||
};
|
||||
|
||||
struct SceneTransitionInfo {
|
||||
uint64_t sceneID{}; //id of the scene being transitioned to.
|
||||
NiPoint3 position;
|
||||
@@ -209,7 +218,8 @@ struct ZoneFile {
|
||||
|
||||
std::vector<ZoneScene> scenes;
|
||||
|
||||
std::string zonePath; //Path to the .luz's folder as written in the file
|
||||
std::vector<ZoneBoundary> zoneBoundaries;
|
||||
|
||||
std::string zoneRawPath; //Path to the .raw file of this zone.
|
||||
std::string zoneName; //Name given to the zone by a level designer
|
||||
std::string zoneDesc; //Description of the zone by a level designer
|
||||
@@ -234,6 +244,7 @@ struct ZoneFile {
|
||||
|
||||
private:
|
||||
void ReadScene(std::istream& file);
|
||||
void ReadZoneBoundaries(std::istream& file);
|
||||
void ReadSceneTransition(std::istream& file);
|
||||
SceneTransitionInfo ReadSceneTransitionInfo(std::istream& file);
|
||||
void ReadPath(std::istream& file);
|
||||
|
||||
Reference in New Issue
Block a user