fix fatal error when skeleton is missing

This commit is contained in:
MihailRis 2026-01-18 23:35:18 +03:00
parent b2df0a7e91
commit 8b5261f4f1
3 changed files with 16 additions and 5 deletions

View file

@ -64,7 +64,7 @@ dv::value Entity::serialize() const {
root[COMP_RIGIDBODY] =
rigidbody.serialize(def.save.body.velocity, def.save.body.settings);
if (skeleton != nullptr) {
if (skeleton != nullptr && skeleton->config != nullptr) {
if (skeleton->config->getName() != def.skeletonName) {
root["skeleton-name"] = skeleton->config->getName();
}