aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/game.cpp19
-rw-r--r--src/client/game.h1
-rw-r--r--src/defaultsettings.cpp2
-rw-r--r--src/script/lua_api/l_clientobject.cpp9
-rw-r--r--src/script/lua_api/l_clientobject.h3
5 files changed, 14 insertions, 20 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index d8800d9ea..491d55a34 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -2453,9 +2453,6 @@ PointedThing Game::updatePointedThing(
ClientMap &map = env.getClientMap();
const NodeDefManager *nodedef = map.getNodeDefManager();
- if (g_settings->getBool("killaura"))
- handleKillaura(shootline.start, shootline.getLength());
-
runData.selected_object = NULL;
hud->pointing_at_object = false;
RaycastState s(shootline, look_for_object, liquids_pointable, ! g_settings->getBool("dont_point_nodes"));
@@ -2532,22 +2529,6 @@ PointedThing Game::updatePointedThing(
return result;
}
-void Game::handleKillaura(v3f origin, f32 max_d)
-{
- ClientEnvironment &env = client->getEnv();
- std::vector<DistanceSortedActiveObject> allObjects;
- env.getActiveObjects(origin, max_d, allObjects);
- for (const auto &allObject : allObjects) {
- ClientActiveObject *obj = allObject.obj;
- s16 id = obj->getId();
- aabb3f selection_box;
- if (! obj->getSelectionBox(&selection_box))
- continue;
- PointedThing pointed(id, v3f(0,0,0), v3s16(0,0,0), 0);
- client->interact(INTERACT_START_DIGGING, pointed);
- }
-}
-
void Game::handlePointingAtNothing(const ItemStack &playerItem)
{
infostream << "Right Clicked in Air" << std::endl;
diff --git a/src/client/game.h b/src/client/game.h
index b8efa3a73..51accc679 100644
--- a/src/client/game.h
+++ b/src/client/game.h
@@ -773,7 +773,6 @@ public:
PointedThing updatePointedThing(
const core::line3d<f32> &shootline, bool liquids_pointable,
bool look_for_object, const v3s16 &camera_offset);
- void handleKillaura(v3f origin, f32 max_d);
void handlePointingAtNothing(const ItemStack &playerItem);
void handlePointingAtNode(const PointedThing &pointed,
const ItemStack &selected_item, const ItemStack &hand_item, f32 dtime);
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index e3332b14f..bcdd80074 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -117,6 +117,8 @@ void set_default_settings(Settings *settings)
settings->setDefault("chat_color", "rainbow");
settings->setDefault("use_chat_color", "false");
settings->setDefault("chat_reverse", "false");
+ settings->setDefault("forcefield", "false");
+ settings->setDefault("friendlist", "");
// Keymap
settings->setDefault("remote_port", "30000");
diff --git a/src/script/lua_api/l_clientobject.cpp b/src/script/lua_api/l_clientobject.cpp
index 90f0bcd15..d88b538a1 100644
--- a/src/script/lua_api/l_clientobject.cpp
+++ b/src/script/lua_api/l_clientobject.cpp
@@ -87,6 +87,14 @@ int ClientObjectRef::l_is_player(lua_State *L)
return 1;
}
+int ClientObjectRef::l_is_local_player(lua_State *L)
+{
+ ClientObjectRef *ref = checkobject(L, 1);
+ GenericCAO *gcao = get_generic_cao(ref, L);
+ lua_pushboolean(L, gcao->isLocalPlayer());
+ return 1;
+}
+
int ClientObjectRef::l_get_name(lua_State *L)
{
ClientObjectRef *ref = checkobject(L, 1);
@@ -210,6 +218,7 @@ luaL_Reg ClientObjectRef::methods[] = {luamethod(ClientObjectRef, get_pos),
luamethod(ClientObjectRef, get_acceleration),
luamethod(ClientObjectRef, get_rotation),
luamethod(ClientObjectRef, is_player),
+ luamethod(ClientObjectRef, is_local_player),
luamethod(ClientObjectRef, get_name),
luamethod(ClientObjectRef, get_attach),
luamethod(ClientObjectRef, get_nametag),
diff --git a/src/script/lua_api/l_clientobject.h b/src/script/lua_api/l_clientobject.h
index 88a6956bc..521591444 100644
--- a/src/script/lua_api/l_clientobject.h
+++ b/src/script/lua_api/l_clientobject.h
@@ -60,6 +60,9 @@ private:
// is_player(self)
static int l_is_player(lua_State *L);
+
+ // is_local_player(self)
+ static int l_is_local_player(lua_State *L);
// get_name(self)
static int l_get_name(lua_State *L);