From 8b1afcafaa47512d8f9909031f624b25d6c38f15 Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Tue, 23 Dec 2025 00:41:09 +0100 Subject: [PATCH] chore: rename iw4 zone constants for zone version --- src/ZoneCommon/Game/IW4/ZoneConstantsIW4.h | 4 ++-- src/ZoneLoading/Game/IW4/ZoneLoaderFactoryIW4.cpp | 4 ++-- src/ZoneWriting/Game/IW4/ZoneWriterFactoryIW4.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ZoneCommon/Game/IW4/ZoneConstantsIW4.h b/src/ZoneCommon/Game/IW4/ZoneConstantsIW4.h index 99ffd343..a9940448 100644 --- a/src/ZoneCommon/Game/IW4/ZoneConstantsIW4.h +++ b/src/ZoneCommon/Game/IW4/ZoneConstantsIW4.h @@ -16,8 +16,8 @@ namespace IW4 static constexpr const char* MAGIC_SIGNED_OAT = "ABff0100"; static constexpr const char* MAGIC_UNSIGNED = "IWffu100"; static constexpr const char* MAGIC_IW4X = "IW4x"; - static constexpr int ZONE_VERSION = 276; - static constexpr int IW4X_ZONE_VERSION = 3; + static constexpr int ZONE_VERSION_PC = 276; + static constexpr int ZONE_VERSION_IW4x = 3; static constexpr int ZONE_VERSION_XENON = 269; static_assert(std::char_traits::length(MAGIC_SIGNED_INFINITY_WARD) == sizeof(ZoneHeader::m_magic)); diff --git a/src/ZoneLoading/Game/IW4/ZoneLoaderFactoryIW4.cpp b/src/ZoneLoading/Game/IW4/ZoneLoaderFactoryIW4.cpp index 768f9cd9..2b0d29df 100644 --- a/src/ZoneLoading/Game/IW4/ZoneLoaderFactoryIW4.cpp +++ b/src/ZoneLoading/Game/IW4/ZoneLoaderFactoryIW4.cpp @@ -48,12 +48,12 @@ namespace std::optional InspectZoneHeaderIw4(const ZoneHeader& header) { - if (endianness::FromLittleEndian(header.m_version) == ZoneConstants::ZONE_VERSION) + if (endianness::FromLittleEndian(header.m_version) == ZoneConstants::ZONE_VERSION_PC) { if (!memcmp(header.m_magic, ZoneConstants::MAGIC_IW4X, std::char_traits::length(ZoneConstants::MAGIC_IW4X))) { if (*reinterpret_cast(&header.m_magic[std::char_traits::length(ZoneConstants::MAGIC_IW4X)]) - == ZoneConstants::IW4X_ZONE_VERSION) + == ZoneConstants::ZONE_VERSION_IW4x) { return ZoneLoaderInspectionResultIW4{ .m_generic_result = diff --git a/src/ZoneWriting/Game/IW4/ZoneWriterFactoryIW4.cpp b/src/ZoneWriting/Game/IW4/ZoneWriterFactoryIW4.cpp index 0bb35364..0f9f1daa 100644 --- a/src/ZoneWriting/Game/IW4/ZoneWriterFactoryIW4.cpp +++ b/src/ZoneWriting/Game/IW4/ZoneWriterFactoryIW4.cpp @@ -39,7 +39,7 @@ namespace ZoneHeader CreateHeaderForParams(const bool isSecure, const bool isOfficial) { ZoneHeader header{}; - header.m_version = ZoneConstants::ZONE_VERSION; + header.m_version = ZoneConstants::ZONE_VERSION_PC; if (isSecure) {