mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
parent
df991edaa8
commit
162ffd7fba
7 changed files with 30 additions and 1 deletions
|
@ -895,6 +895,9 @@ int ObjectRef::l_set_yaw(lua_State *L)
|
|||
ObjectRef *ref = checkobject(L, 1);
|
||||
LuaEntitySAO *co = getluaobject(ref);
|
||||
if (co == NULL) return 0;
|
||||
if (isNaN(L, 2))
|
||||
throw LuaError("ObjectRef::set_yaw: NaN value is not allowed.");
|
||||
|
||||
float yaw = luaL_checknumber(L, 2) * core::RADTODEG;
|
||||
// Do it
|
||||
co->setYaw(yaw);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue