summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2018-06-08 00:46:10 +0100
committerGitHub <noreply@github.com>2018-06-08 00:46:10 +0100
commit9ca37d86a3f8fd35150880e3c64cb81796430d68 (patch)
tree4acf9845f3915a69e878c1c2b103ae48df75d961 /doc/lua_api.txt
parent9f8582dcdf24600b54e8c178de37f3a222c31df2 (diff)
downloadminetest-9ca37d86a3f8fd35150880e3c64cb81796430d68.tar.gz
minetest-9ca37d86a3f8fd35150880e3c64cb81796430d68.tar.bz2
minetest-9ca37d86a3f8fd35150880e3c64cb81796430d68.zip
Lua_api.txt: Warn of errors possible with VoxelArea:index()/indexp() (#7422)
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index d9cf96800..29befca52 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -4736,9 +4736,14 @@ The coordinates are *inclusive*, like most other things in Minetest.
`MaxEdge`.
* `index(x, y, z)`: returns the index of an absolute position in a flat array
starting at `1`.
- * useful for things like `VoxelManip`, raw Schematic specifiers,
+ * `x`, `y` and `z` must be integers to avoid an incorrect index result.
+ * The position (x, y, z) is not checked for being inside the area volume,
+ being outside can cause an incorrect index result.
+ * Useful for things like `VoxelManip`, raw Schematic specifiers,
`PerlinNoiseMap:get2d`/`3dMap`, and so on.
-* `indexp(p)`: same as above, except takes a vector
+* `indexp(p)`: same functionality as `index(x, y, z)` but takes a vector.
+ * As with `index(x, y, z)`, the components of `p` must be integers, and `p`
+ is not checked for being inside the area volume.
* `position(i)`: returns the absolute position vector corresponding to index
`i`.
* `contains(x, y, z)`: check if (`x`,`y`,`z`) is inside area formed by