diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index 2667ad7d..8e8b3096 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -252,15 +252,16 @@ namespace Components Utils::IO::WriteFile(Utils::String::VA("raw/%s.ents", name.data()), asset.mapEnts->entityString, true); } + static std::string mapEntities; FileSystem::File ents(name + ".ents"); if (ents.exists()) { - static auto mapEntities = ents.getBuffer(); - asset.mapEnts->entityString = const_cast(mapEntities.data()); + mapEntities = ents.getBuffer(); + asset.mapEnts->entityString = mapEntities.data(); asset.mapEnts->numEntityChars = mapEntities.size() + 1; } } - + // This is broken if ((type == Game::XAssetType::ASSET_TYPE_MENU || type == Game::XAssetType::ASSET_TYPE_MENULIST) && Zones::Version() >= 359) { diff --git a/src/Game/Structs.hpp b/src/Game/Structs.hpp index 63acd2a4..5f35b8b4 100644 --- a/src/Game/Structs.hpp +++ b/src/Game/Structs.hpp @@ -1983,7 +1983,7 @@ namespace Game struct __declspec(align(4)) MapEnts { const char *name; - char *entityString; + const char *entityString; int numEntityChars; MapTriggers trigger; Stage *stages;