summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorsapier <sapier at gmx dot net>2017-01-21 15:58:07 +0100
committersapier <sapier at gmx dot net>2017-01-28 15:57:54 +0100
commit814ee971f70a8ef1fa4a470bcf385300686e9e70 (patch)
tree441f17f8a118a8bad5cc6ad5ca3067f90bd28f6a /doc/lua_api.txt
parent953cbb3b15997a0e7c7c32af2365cb5046a9e476 (diff)
downloadminetest-814ee971f70a8ef1fa4a470bcf385300686e9e70.tar.gz
minetest-814ee971f70a8ef1fa4a470bcf385300686e9e70.tar.bz2
minetest-814ee971f70a8ef1fa4a470bcf385300686e9e70.zip
Make entity on_punch have same signature and behaviour as player on_punch
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index ee7d57c2f..ff745c1c2 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1392,7 +1392,7 @@ a non-tool item, so that it can do something else than take damage.
On the Lua side, every punch calls:
- entity:on_punch(puncher, time_from_last_punch, tool_capabilities, direction)
+ entity:on_punch(puncher, time_from_last_punch, tool_capabilities, direction, damage)
This should never be called directly, because damage is usually not handled by
the entity itself.
@@ -1403,6 +1403,9 @@ the entity itself.
* `tool_capabilities` can be `nil`.
* `direction` is a unit vector, pointing from the source of the punch to
the punched object.
+* `damage` damage that will be done to entity
+Return value of this function will determin if damage is done by this function
+(retval true) or shall be done by engine (retval false)
To punch an entity/object in Lua, call: