fix: UB in DemoLevel

This commit is contained in:
Tropical 2026-03-03 16:08:17 -06:00
parent cc34168277
commit 17d6e670cc
2 changed files with 12 additions and 2 deletions

View file

@ -2,7 +2,16 @@
#include "DemoLevel.h"
#include "../Minecraft.World/net.minecraft.world.level.storage.h"
DemoLevel::DemoLevel(shared_ptr<LevelStorage> levelStorage, const wstring& levelName) : Level(levelStorage, levelName, DEMO_LEVEL_SEED)
const LevelSettings DemoLevel::DEMO_LEVEL_SETTINGS = LevelSettings(
DemoLevel::DEMO_LEVEL_SEED,
GameType::SURVIVAL,
false,
false,
false, LevelType::lvl_normal_1_1, LEVEL_MAX_WIDTH,
1.0
);
DemoLevel::DemoLevel(shared_ptr<LevelStorage> levelStorage, const wstring& levelName) : Level(levelStorage, levelName, &DEMO_LEVEL_SETTINGS)
{
}

View file

@ -4,7 +4,8 @@
class DemoLevel : public Level
{
private:
static const __int64 DEMO_LEVEL_SEED = 0; // 4J - TODO - was "Don't Look Back".hashCode();
static const __int64 DEMO_LEVEL_SEED = 0; // 4J - TODO - was "Don't Look Back".hashCode();
static const LevelSettings DEMO_LEVEL_SETTINGS;
static const int DEMO_SPAWN_X = 796;
static const int DEMO_SPAWN_Y = 72;
static const int DEMO_SPAWN_Z = -731;