mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-14 15:40:18 +00:00
Throw on invalid bone group indices in getActiveGroup
This commit is contained in:
parent
b001deeff7
commit
d226b72592
@ -218,6 +218,8 @@ namespace MWLua
|
|||||||
getMutableAnimationOrThrow(ObjectVariant(object))->adjustSpeedMult(groupname, speed);
|
getMutableAnimationOrThrow(ObjectVariant(object))->adjustSpeedMult(groupname, speed);
|
||||||
};
|
};
|
||||||
api["getActiveGroup"] = [](const sol::object& object, MWRender::BoneGroup boneGroup) -> std::string_view {
|
api["getActiveGroup"] = [](const sol::object& object, MWRender::BoneGroup boneGroup) -> std::string_view {
|
||||||
|
if (boneGroup < 0 || boneGroup >= BoneGroup::Num_BoneGroups)
|
||||||
|
throw std::runtime_error("Invalid bonegroup: " + std::to_string(boneGroup));
|
||||||
return getConstAnimationOrThrow(ObjectVariant(object))->getActiveGroup(boneGroup);
|
return getConstAnimationOrThrow(ObjectVariant(object))->getActiveGroup(boneGroup);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user