Fix crash
This commit is contained in:
parent
7601985f32
commit
09e565e431
@ -252,15 +252,16 @@ namespace Components
|
|||||||
Utils::IO::WriteFile(Utils::String::VA("raw/%s.ents", name.data()), asset.mapEnts->entityString, true);
|
Utils::IO::WriteFile(Utils::String::VA("raw/%s.ents", name.data()), asset.mapEnts->entityString, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string mapEntities;
|
||||||
FileSystem::File ents(name + ".ents");
|
FileSystem::File ents(name + ".ents");
|
||||||
if (ents.exists())
|
if (ents.exists())
|
||||||
{
|
{
|
||||||
static auto mapEntities = ents.getBuffer();
|
mapEntities = ents.getBuffer();
|
||||||
asset.mapEnts->entityString = const_cast<char*>(mapEntities.data());
|
asset.mapEnts->entityString = mapEntities.data();
|
||||||
asset.mapEnts->numEntityChars = mapEntities.size() + 1;
|
asset.mapEnts->numEntityChars = mapEntities.size() + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is broken
|
// This is broken
|
||||||
if ((type == Game::XAssetType::ASSET_TYPE_MENU || type == Game::XAssetType::ASSET_TYPE_MENULIST) && Zones::Version() >= 359)
|
if ((type == Game::XAssetType::ASSET_TYPE_MENU || type == Game::XAssetType::ASSET_TYPE_MENULIST) && Zones::Version() >= 359)
|
||||||
{
|
{
|
||||||
|
@ -1983,7 +1983,7 @@ namespace Game
|
|||||||
struct __declspec(align(4)) MapEnts
|
struct __declspec(align(4)) MapEnts
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
char *entityString;
|
const char *entityString;
|
||||||
int numEntityChars;
|
int numEntityChars;
|
||||||
MapTriggers trigger;
|
MapTriggers trigger;
|
||||||
Stage *stages;
|
Stage *stages;
|
||||||
|
Loading…
Reference in New Issue
Block a user