diff options
| author | ModMaker101 <119018978+ModMaker101@users.noreply.github.com> | 2026-03-07 21:56:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-08 09:56:03 +0700 |
| commit | a9be52c41a02d207233199e98898fe7483d7e817 (patch) | |
| tree | 71dfaec3a86b05e9ca409b97d8eb9d7f993bfdd0 /Minecraft.World/LevelData.cpp | |
| parent | 1be5faaea781402e7de06b263eeca4c688b7712c (diff) | |
Project modernization (#630)
* Fixed boats falling and a TP glitch #266
* Replaced every C-style cast with C++ ones
* Replaced every C-style cast with C++ ones
* Fixed boats falling and a TP glitch #266
* Updated NULL to nullptr and fixing some type issues
* Modernized and fixed a few bugs
- Replaced most instances of `NULL` with `nullptr`.
- Replaced most `shared_ptr(new ...)` with `make_shared`.
- Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances.
* Fixing more conflicts
* Replace int loops with size_t and start work on overrides
Diffstat (limited to 'Minecraft.World/LevelData.cpp')
| -rw-r--r-- | Minecraft.World/LevelData.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Minecraft.World/LevelData.cpp b/Minecraft.World/LevelData.cpp index 05bc2060..fbc10ddb 100644 --- a/Minecraft.World/LevelData.cpp +++ b/Minecraft.World/LevelData.cpp @@ -18,7 +18,7 @@ LevelData::LevelData(CompoundTag *tag) { wstring generatorName = tag->getString(L"generatorName"); m_pGenerator = LevelType::getLevelType(generatorName); - if (m_pGenerator == NULL) + if (m_pGenerator == nullptr) { m_pGenerator = LevelType::lvl_normal; } @@ -188,8 +188,13 @@ LevelData::LevelData(CompoundTag *tag) dimension = loadedPlayerTag->getInt(L"Dimension"); } else +<<<<<<< HEAD + { + this->loadedPlayerTag = nullptr; +======= { this->loadedPlayerTag = NULL; +>>>>>>> origin/main } */ dimension = 0; @@ -215,7 +220,7 @@ LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName) gameTime = -1; lastPlayed = 0; sizeOnDisk = 0; - // this->loadedPlayerTag = NULL; // 4J - we don't store this anymore + // this->loadedPlayerTag = nullptr; // 4J - we don't store this anymore dimension = 0; version = 0; rainTime = 0; @@ -432,7 +437,7 @@ int64_t LevelData::getSizeOnDisk() CompoundTag *LevelData::getLoadedPlayerTag() { - return NULL; // 4J - we don't store this anymore + return nullptr; // 4J - we don't store this anymore } // 4J Removed TU9 as it's never accurate due to the dimension never being set @@ -712,7 +717,7 @@ void LevelData::getMoatFlags(bool* bClassicEdgeMoat, bool* bSmallEdgeMoat, bool* int LevelData::getXZHellSizeOld() { - int hellXZSizeOld = ceil((float)m_xzSizeOld / m_hellScaleOld); + int hellXZSizeOld = ceil(static_cast<float>(m_xzSizeOld) / m_hellScaleOld); while(hellXZSizeOld > HELL_LEVEL_MAX_WIDTH && m_hellScaleOld < HELL_LEVEL_MAX_SCALE) { |
