aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_object.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-10-25 00:45:18 -0400
committerkwolekr <kwolekr@minetest.net>2015-10-25 23:06:48 -0400
commit54f1267c2c87daea769966c694777a2e5977f870 (patch)
treeae08897774c1b1d1ecae0ad1a31b147c9c98dd02 /src/script/lua_api/l_object.cpp
parent3936a5e3f71d46e61f819b8f6c85dd47a440f21e (diff)
downloadminetest-54f1267c2c87daea769966c694777a2e5977f870.tar.gz
minetest-54f1267c2c87daea769966c694777a2e5977f870.tar.bz2
minetest-54f1267c2c87daea769966c694777a2e5977f870.zip
SAPI: Mark all Lua API functions requiring envlock
Diffstat (limited to 'src/script/lua_api/l_object.cpp')
-rw-r--r--src/script/lua_api/l_object.cpp34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp
index 2bd5299dc..52190d60e 100644
--- a/src/script/lua_api/l_object.cpp
+++ b/src/script/lua_api/l_object.cpp
@@ -31,10 +31,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "hud.h"
#include "scripting_game.h"
-#define GET_ENV_PTR ServerEnvironment* env = \
- dynamic_cast<ServerEnvironment*>(getEnv(L)); \
- if (env == NULL) return 0
-
struct EnumString es_HudElementType[] =
{
{HUD_ELEM_IMAGE, "image"},
@@ -132,7 +128,6 @@ int ObjectRef::gc_object(lua_State *L) {
// remove(self)
int ObjectRef::l_remove(lua_State *L)
{
- NO_MAP_LOCK_REQUIRED;
GET_ENV_PTR;
ObjectRef *ref = checkobject(L, 1);
@@ -409,6 +404,7 @@ int ObjectRef::l_get_armor_groups(lua_State *L)
// physics_override_gravity, sneak, sneak_glitch)
int ObjectRef::l_set_physics_override(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
PlayerSAO *co = (PlayerSAO *) getobject(ref);
if (co == NULL) return 0;
@@ -441,6 +437,7 @@ int ObjectRef::l_set_physics_override(lua_State *L)
// get_physics_override(self)
int ObjectRef::l_get_physics_override(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
PlayerSAO *co = (PlayerSAO *)getobject(ref);
if (co == NULL)
@@ -509,7 +506,7 @@ int ObjectRef::l_get_animation(lua_State *L)
// set_local_animation(self, {stand/idle}, {walk}, {dig}, {walk+dig}, frame_speed)
int ObjectRef::l_set_local_animation(lua_State *L)
{
- //NO_MAP_LOCK_REQUIRED;
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -534,7 +531,7 @@ int ObjectRef::l_set_local_animation(lua_State *L)
// get_local_animation(self)
int ObjectRef::l_get_local_animation(lua_State *L)
{
- //NO_MAP_LOCK_REQUIRED
+ NO_MAP_LOCK_REQUIRED
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -555,7 +552,7 @@ int ObjectRef::l_get_local_animation(lua_State *L)
// set_eye_offset(self, v3f first pv, v3f third pv)
int ObjectRef::l_set_eye_offset(lua_State *L)
{
- //NO_MAP_LOCK_REQUIRED;
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -585,7 +582,7 @@ int ObjectRef::l_set_eye_offset(lua_State *L)
// get_eye_offset(self)
int ObjectRef::l_get_eye_offset(lua_State *L)
{
- //NO_MAP_LOCK_REQUIRED;
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -642,7 +639,6 @@ int ObjectRef::l_get_bone_position(lua_State *L)
// set_attach(self, parent, bone, position, rotation)
int ObjectRef::l_set_attach(lua_State *L)
{
- NO_MAP_LOCK_REQUIRED;
GET_ENV_PTR;
ObjectRef *ref = checkobject(L, 1);
@@ -681,7 +677,6 @@ int ObjectRef::l_set_attach(lua_State *L)
// get_attach(self)
int ObjectRef::l_get_attach(lua_State *L)
{
- NO_MAP_LOCK_REQUIRED;
GET_ENV_PTR;
ObjectRef *ref = checkobject(L, 1);
@@ -709,7 +704,6 @@ int ObjectRef::l_get_attach(lua_State *L)
// set_detach(self)
int ObjectRef::l_set_detach(lua_State *L)
{
- NO_MAP_LOCK_REQUIRED;
GET_ENV_PTR;
ObjectRef *ref = checkobject(L, 1);
@@ -1137,6 +1131,7 @@ int ObjectRef::l_get_player_control_bits(lua_State *L)
// hud_add(self, form)
int ObjectRef::l_hud_add(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1199,6 +1194,7 @@ int ObjectRef::l_hud_add(lua_State *L)
// hud_remove(self, id)
int ObjectRef::l_hud_remove(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1218,6 +1214,7 @@ int ObjectRef::l_hud_remove(lua_State *L)
// hud_change(self, id, stat, data)
int ObjectRef::l_hud_change(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1294,6 +1291,7 @@ int ObjectRef::l_hud_change(lua_State *L)
// hud_get(self, id)
int ObjectRef::l_hud_get(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1344,6 +1342,7 @@ int ObjectRef::l_hud_get(lua_State *L)
// hud_set_flags(self, flags)
int ObjectRef::l_hud_set_flags(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1369,6 +1368,7 @@ int ObjectRef::l_hud_set_flags(lua_State *L)
int ObjectRef::l_hud_get_flags(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1394,6 +1394,7 @@ int ObjectRef::l_hud_get_flags(lua_State *L)
// hud_set_hotbar_itemcount(self, hotbar_itemcount)
int ObjectRef::l_hud_set_hotbar_itemcount(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1411,6 +1412,7 @@ int ObjectRef::l_hud_set_hotbar_itemcount(lua_State *L)
// hud_get_hotbar_itemcount(self)
int ObjectRef::l_hud_get_hotbar_itemcount(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1425,6 +1427,7 @@ int ObjectRef::l_hud_get_hotbar_itemcount(lua_State *L)
// hud_set_hotbar_image(self, name)
int ObjectRef::l_hud_set_hotbar_image(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1439,6 +1442,7 @@ int ObjectRef::l_hud_set_hotbar_image(lua_State *L)
// hud_get_hotbar_image(self)
int ObjectRef::l_hud_get_hotbar_image(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1452,6 +1456,7 @@ int ObjectRef::l_hud_get_hotbar_image(lua_State *L)
// hud_set_hotbar_selected_image(self, name)
int ObjectRef::l_hud_set_hotbar_selected_image(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1466,6 +1471,7 @@ int ObjectRef::l_hud_set_hotbar_selected_image(lua_State *L)
// hud_get_hotbar_selected_image(self)
int ObjectRef::l_hud_get_hotbar_selected_image(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1479,6 +1485,7 @@ int ObjectRef::l_hud_get_hotbar_selected_image(lua_State *L)
// set_sky(self, bgcolor, type, list)
int ObjectRef::l_set_sky(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1517,6 +1524,7 @@ int ObjectRef::l_set_sky(lua_State *L)
// get_sky(self)
int ObjectRef::l_get_sky(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1544,6 +1552,7 @@ int ObjectRef::l_get_sky(lua_State *L)
// override_day_night_ratio(self, brightness=0...1)
int ObjectRef::l_override_day_night_ratio(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)
@@ -1566,6 +1575,7 @@ int ObjectRef::l_override_day_night_ratio(lua_State *L)
// get_day_night_ratio(self)
int ObjectRef::l_get_day_night_ratio(lua_State *L)
{
+ NO_MAP_LOCK_REQUIRED;
ObjectRef *ref = checkobject(L, 1);
Player *player = getplayer(ref);
if (player == NULL)