1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix set_bone_position regression (error on passing none)

This commit is contained in:
Lars Müller 2023-12-21 18:55:12 +01:00 committed by GitHub
parent cb38b841af
commit cad8e895f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 10 deletions

View file

@ -520,7 +520,7 @@ int ObjectRef::l_set_bone_position(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
log_deprecated(L,"Deprecated call to set_bone_position, use set_bone_override instead");
log_deprecated(L, "Deprecated call to set_bone_position, use set_bone_override instead", 1, true);
ObjectRef *ref = checkObject<ObjectRef>(L, 1);
ServerActiveObject *sao = getobject(ref);
@ -528,12 +528,12 @@ int ObjectRef::l_set_bone_position(lua_State *L)
return 0;
std::string bone;
if (!lua_isnil(L, 2))
if (!lua_isnoneornil(L, 2))
bone = readParam<std::string>(L, 2);
BoneOverride props;
if (!lua_isnil(L, 3))
if (!lua_isnoneornil(L, 3))
props.position.vector = check_v3f(L, 3);
if (!lua_isnil(L, 4))
if (!lua_isnoneornil(L, 4))
props.rotation.next = core::quaternion(check_v3f(L, 4) * core::DEGTORAD);
props.position.absolute = true;
props.rotation.absolute = true;
@ -546,7 +546,7 @@ int ObjectRef::l_get_bone_position(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
log_deprecated(L,"Deprecated call to get_bone_position, use get_bone_override instead");
log_deprecated(L, "Deprecated call to get_bone_position, use get_bone_override instead", 1, true);
ObjectRef *ref = checkObject<ObjectRef>(L, 1);
ServerActiveObject *sao = getobject(ref);