From c1b3ed4180dea16e2fa77663a7d2bf155595dd60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sun, 7 May 2017 12:13:15 +0200 Subject: Player attrs: permits to remove an attribute by setting value to nil (#5716) * Player attrs: permits to remove an attribute by setting value to nil When doing player:set_attribute("attr", nil) remove attribute Also remove a useless check on C++ API part (already done by checkplayer) Fix #5709 --- doc/lua_api.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 607a13fdd..d8e297f4c 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -3028,7 +3028,9 @@ This is basically a reference to a C++ `ServerActiveObject` * `0`: player is drowning, * `1`-`10`: remaining number of bubbles * `11`: bubbles bar is not shown -* `set_attribute(attribute, value)`: sets an extra attribute with value on player +* `set_attribute(attribute, value)`: + * Sets an extra attribute with value on player. + * If value is nil, remove attribute from player. * `get_attribute(attribute)`: returns value for extra attribute. Returns nil if no attribute found. * `set_inventory_formspec(formspec)` * Redefine player's inventory form -- cgit v1.2.3