mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 05:27:19 +00:00
fix: general issues with dismantling (#1304)
This commit is contained in:
parent
98822d400f
commit
57e3a4f4ef
@ -410,12 +410,19 @@ void Item::DisassembleModel(uint32_t numToDismantle) {
|
||||
}
|
||||
|
||||
std::string renderAsset = std::string(result.getStringField(0));
|
||||
|
||||
// normalize path slashes
|
||||
for (auto& c : renderAsset) {
|
||||
if (c == '\\') c = '/';
|
||||
}
|
||||
|
||||
std::string lxfmlFolderName = std::string(result.getStringField(1));
|
||||
if (!lxfmlFolderName.empty()) lxfmlFolderName.insert(0, "/");
|
||||
|
||||
std::vector<std::string> renderAssetSplit = GeneralUtils::SplitString(renderAsset, '\\');
|
||||
if (renderAssetSplit.size() == 0) return;
|
||||
std::vector<std::string> renderAssetSplit = GeneralUtils::SplitString(renderAsset, '/');
|
||||
if (renderAssetSplit.empty()) return;
|
||||
|
||||
std::string lxfmlPath = "BrickModels/" + lxfmlFolderName + "/" + GeneralUtils::SplitString(renderAssetSplit.back(), '.').at(0) + ".lxfml";
|
||||
std::string lxfmlPath = "BrickModels" + lxfmlFolderName + "/" + GeneralUtils::SplitString(renderAssetSplit.back(), '.').at(0) + ".lxfml";
|
||||
auto buffer = Game::assetManager->GetFileAsBuffer(lxfmlPath.c_str());
|
||||
|
||||
if (!buffer.m_Success) {
|
||||
@ -461,8 +468,8 @@ void Item::DisassembleModel(uint32_t numToDismantle) {
|
||||
auto* model = scene->FirstChildElement("Model");
|
||||
if (!model) return;
|
||||
|
||||
auto* group = model->FirstChildElement("Group");
|
||||
if (!group) return;
|
||||
bricks = model->FirstChildElement("Group");
|
||||
if (!bricks) return;
|
||||
}
|
||||
|
||||
auto* currentBrick = bricks->FirstChildElement(searchTerm.c_str());
|
||||
|
Loading…
Reference in New Issue
Block a user