summaryrefslogtreecommitdiff
path: root/src/environment.h
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-04-10 22:06:24 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2020-04-11 13:12:51 +0200
commit054c5dfaa35dd79560a465ccc0ef214cb5f34c88 (patch)
tree7f9e2feefbee0708f3dc7371d3615767deba0048 /src/environment.h
parentf105bc8dc2444d98a9cd74a2caa0013ce2e07008 (diff)
downloadminetest-054c5dfaa35dd79560a465ccc0ef214cb5f34c88.tar.gz
minetest-054c5dfaa35dd79560a465ccc0ef214cb5f34c88.tar.bz2
minetest-054c5dfaa35dd79560a465ccc0ef214cb5f34c88.zip
scriptapi: Sort out ServerEnvironment / Environment distinction properly
The API implementation is shared between CSM and SSM. Functions should retrieve a plain env when they do not need any server-specific functions.
Diffstat (limited to 'src/environment.h')
-rw-r--r--src/environment.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/environment.h b/src/environment.h
index f568ba228..91c33ba15 100644
--- a/src/environment.h
+++ b/src/environment.h
@@ -77,6 +77,16 @@ public:
u32 getDayCount();
/*!
+ * Returns false if the given line intersects with a
+ * non-air node, true otherwise.
+ * \param pos1 start of the line
+ * \param pos2 end of the line
+ * \param p output, position of the first non-air node
+ * the line intersects
+ */
+ bool line_of_sight(v3f pos1, v3f pos2, v3s16 *p = nullptr);
+
+ /*!
* Gets the objects pointed by the shootline as
* pointed things.
* If this is a client environment, the local player