mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 17:54:01 +00:00
Fix Pet Taming causing seg fault (#818)
* Fix Pet Taming * Fix Pet Taming * fix pet taming path loading just make it go to build file since the asset managet handles intermediate steps there is never res in the path in the live db, so no need to check * special case BrickModels to uppercase if unpacked remove redundent variable Co-authored-by: Aaron Kimbrell <aronwk.aaron@gmail.com>
This commit is contained in:
@@ -194,21 +194,7 @@ void PetComponent::OnUse(Entity* originator) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto lxfAsset = std::string(result.getStringField(0));
|
||||
|
||||
std::vector<std::string> lxfAssetSplit = GeneralUtils::SplitString(lxfAsset, '\\');
|
||||
|
||||
lxfAssetSplit.erase(lxfAssetSplit.begin());
|
||||
|
||||
buildFile = "res/BrickModels";
|
||||
|
||||
for (auto part : lxfAssetSplit) {
|
||||
std::transform(part.begin(), part.end(), part.begin(), [](unsigned char c) {
|
||||
return std::tolower(c);
|
||||
});
|
||||
|
||||
buildFile += "/" + part;
|
||||
}
|
||||
buildFile = std::string(result.getStringField(0));
|
||||
|
||||
PetPuzzleData data;
|
||||
data.buildFile = buildFile;
|
||||
|
@@ -18,7 +18,7 @@ std::vector<Brick>& BrickDatabase::GetBricks(const std::string& lxfmlPath) {
|
||||
return cached->second;
|
||||
}
|
||||
|
||||
AssetMemoryBuffer buffer = Game::assetManager->GetFileAsBuffer(("client/" + lxfmlPath).c_str());
|
||||
AssetMemoryBuffer buffer = Game::assetManager->GetFileAsBuffer((lxfmlPath).c_str());
|
||||
std::istream file(&buffer);
|
||||
if (!file.good()) {
|
||||
return emptyCache;
|
||||
|
Reference in New Issue
Block a user