mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix: destroyed skeleton config access on skeleton reload
This commit is contained in:
parent
33db2633a2
commit
9893c09fd5
9 changed files with 35 additions and 22 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue