mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-05-10 02:55:00 +00:00
fix crash when saving skel after bones were removed
This commit is contained in:
parent
0469ab8dfb
commit
288fb6b7fa
1 changed files with 12 additions and 9 deletions
|
@ -1146,6 +1146,8 @@ bool SkeletalSprite::saveSkeletal(const std::string &fn)
|
||||||
{
|
{
|
||||||
BoneKeyframe *b = &a->keyframes[j].keyframes[k];
|
BoneKeyframe *b = &a->keyframes[j].keyframes[k];
|
||||||
Bone *bone = this->getBoneByIdx(b->idx);
|
Bone *bone = this->getBoneByIdx(b->idx);
|
||||||
|
if(bone)
|
||||||
|
{
|
||||||
os << b->idx << " " << b->x << " " << b->y << " " << b->rot << " ";
|
os << b->idx << " " << b->x << " " << b->y << " " << b->rot << " ";
|
||||||
// don't want to store grid points if they can be regenerated automatically
|
// don't want to store grid points if they can be regenerated automatically
|
||||||
size_t usedGridSize = bone->gridType == Quad::GRID_INTERP ? 0 : b->grid.size();
|
size_t usedGridSize = bone->gridType == Quad::GRID_INTERP ? 0 : b->grid.size();
|
||||||
|
@ -1156,6 +1158,7 @@ bool SkeletalSprite::saveSkeletal(const std::string &fn)
|
||||||
if (b->doScale)
|
if (b->doScale)
|
||||||
szos << b->idx << " " << b->sx << " " << b->sy << " ";
|
szos << b->idx << " " << b->sx << " " << b->sy << " ";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
std::string szoss = szos.str();
|
std::string szoss = szos.str();
|
||||||
if (!szoss.empty())
|
if (!szoss.empty())
|
||||||
key->SetAttribute("sz", szoss.c_str());
|
key->SetAttribute("sz", szoss.c_str());
|
||||||
|
|
Loading…
Add table
Reference in a new issue