mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +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
|
|
@ -108,13 +108,13 @@ static int l_set_skeleton(lua::State* L) {
|
|||
}
|
||||
if (auto entity = get_entity(L, 1)) {
|
||||
std::string skeletonName = lua::require_string(L, 2);
|
||||
auto rigConfig = assets->get<rigging::SkeletonConfig>(skeletonName);
|
||||
auto rigConfig = assets->getShared<rigging::SkeletonConfig>(skeletonName);
|
||||
if (rigConfig == nullptr) {
|
||||
throw std::runtime_error(
|
||||
"skeleton not found '" + skeletonName + "'"
|
||||
);
|
||||
}
|
||||
entity->setRig(rigConfig);
|
||||
entity->setRig(std::move(rigConfig));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue