fix: destroyed skeleton config access on skeleton reload

This commit is contained in:
MihailRis 2026-04-05 10:31:44 +03:00
parent 33db2633a2
commit 9893c09fd5
9 changed files with 35 additions and 22 deletions

View file

@ -155,7 +155,7 @@ void Entities::loadEntity(const dv::value& map, Entity entity) {
std::string skeletonName = skeleton->config->getName();
map.at("skeleton-name").get(skeletonName);
if (skeletonName != skeleton->config->getName()) {
skeleton->config = assets->get<rigging::SkeletonConfig>(skeletonName);
skeleton->config = assets->getShared<rigging::SkeletonConfig>(skeletonName);
}
if (auto foundSkeleton = map.at(COMP_SKELETON)) {
skeleton->deserialize(*foundSkeleton);
@ -470,7 +470,7 @@ void Entities::render(
continue;
}
const auto* rigConfig = skeleton.config;
const auto& rigConfig = skeleton.config;
if (rigConfig) {
rigConfig->render(
assets, batch, skeleton, transform.rot, pos, size