From 36d35f2fe31a429c1510df680801940472416d45 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Thu, 14 May 2020 21:16:45 +0200 Subject: CSM: Bugfixes to camera:get_pos() and camera:get_fov() closes #9857 --- src/script/lua_api/l_env.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/script/lua_api/l_env.cpp') diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index cabca124d..b8a8a5ce1 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -780,8 +780,8 @@ int ModApiEnvMod::l_find_node_near(lua_State *L) #ifndef SERVER // Client API limitations - if (getClient(L)) - radius = getClient(L)->CSMClampRadius(pos, radius); + if (Client *client = getClient(L)) + radius = client->CSMClampRadius(pos, radius); #endif for (int d = start_radius; d <= radius; d++) { @@ -811,9 +811,9 @@ int ModApiEnvMod::l_find_nodes_in_area(lua_State *L) const NodeDefManager *ndef = env->getGameDef()->ndef(); #ifndef SERVER - if (getClient(L)) { - minp = getClient(L)->CSMClampPos(minp); - maxp = getClient(L)->CSMClampPos(maxp); + if (Client *client = getClient(L)) { + minp = client->CSMClampPos(minp); + maxp = client->CSMClampPos(maxp); } #endif @@ -887,9 +887,9 @@ int ModApiEnvMod::l_find_nodes_in_area_under_air(lua_State *L) const NodeDefManager *ndef = env->getGameDef()->ndef(); #ifndef SERVER - if (getClient(L)) { - minp = getClient(L)->CSMClampPos(minp); - maxp = getClient(L)->CSMClampPos(maxp); + if (Client *client = getClient(L)) { + minp = client->CSMClampPos(minp); + maxp = client->CSMClampPos(maxp); } #endif -- cgit v1.2.3