mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
Fix get_bone_position() on unset bones modifying their position
closes #11840
This commit is contained in:
parent
ff934d538c
commit
d9d219356a
@ -84,8 +84,11 @@ void UnitSAO::setBonePosition(const std::string &bone, v3f position, v3f rotatio
|
|||||||
|
|
||||||
void UnitSAO::getBonePosition(const std::string &bone, v3f *position, v3f *rotation)
|
void UnitSAO::getBonePosition(const std::string &bone, v3f *position, v3f *rotation)
|
||||||
{
|
{
|
||||||
*position = m_bone_position[bone].X;
|
auto it = m_bone_position.find(bone);
|
||||||
*rotation = m_bone_position[bone].Y;
|
if (it != m_bone_position.end()) {
|
||||||
|
*position = it->second.X;
|
||||||
|
*rotation = it->second.Y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
Loading…
Reference in New Issue
Block a user