diff options
Diffstat (limited to 'src/script/lua_api/l_object.cpp')
-rw-r--r-- | src/script/lua_api/l_object.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index 8377f95c8..f87c02a6d 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -898,7 +898,7 @@ int ObjectRef::l_set_yaw(lua_State *L) if (isNaN(L, 2)) throw LuaError("ObjectRef::set_yaw: NaN value is not allowed."); - float yaw = luaL_checknumber(L, 2) * core::RADTODEG; + float yaw = readParam<float>(L, 2) * core::RADTODEG; // Do it co->setYaw(yaw); return 0; @@ -1118,7 +1118,7 @@ int ObjectRef::l_set_look_vertical(lua_State *L) ObjectRef *ref = checkobject(L, 1); PlayerSAO* co = getplayersao(ref); if (co == NULL) return 0; - float pitch = luaL_checknumber(L, 2) * core::RADTODEG; + float pitch = readParam<float>(L, 2) * core::RADTODEG; // Do it co->setPitchAndSend(pitch); return 1; @@ -1131,7 +1131,7 @@ int ObjectRef::l_set_look_horizontal(lua_State *L) ObjectRef *ref = checkobject(L, 1); PlayerSAO* co = getplayersao(ref); if (co == NULL) return 0; - float yaw = luaL_checknumber(L, 2) * core::RADTODEG; + float yaw = readParam<float>(L, 2) * core::RADTODEG; // Do it co->setYawAndSend(yaw); return 1; @@ -1149,7 +1149,7 @@ int ObjectRef::l_set_look_pitch(lua_State *L) ObjectRef *ref = checkobject(L, 1); PlayerSAO* co = getplayersao(ref); if (co == NULL) return 0; - float pitch = luaL_checknumber(L, 2) * core::RADTODEG; + float pitch = readParam<float>(L, 2) * core::RADTODEG; // Do it co->setPitchAndSend(pitch); return 1; @@ -1167,7 +1167,7 @@ int ObjectRef::l_set_look_yaw(lua_State *L) ObjectRef *ref = checkobject(L, 1); PlayerSAO* co = getplayersao(ref); if (co == NULL) return 0; - float yaw = luaL_checknumber(L, 2) * core::RADTODEG; + float yaw = readParam<float>(L, 2) * core::RADTODEG; // Do it co->setYawAndSend(yaw); return 1; @@ -1739,7 +1739,7 @@ int ObjectRef::l_override_day_night_ratio(lua_State *L) float ratio = 0.0f; if (!lua_isnil(L, 2)) { do_override = true; - ratio = luaL_checknumber(L, 2); + ratio = readParam<float>(L, 2); } if (!getServer(L)->overrideDayNightRatio(player, do_override, ratio)) |