From 0ea070a3bdbd2cc959f2814021208431881397dc Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 14 Jul 2014 18:29:22 +0200 Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=9Ccancelall=E2=80=9D=20example=20(?= =?UTF-8?q?cancels=20user=E2=80=99s=20effects)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/examples.lua b/examples.lua index ba798f7..dd30a71 100644 --- a/examples.lua +++ b/examples.lua @@ -165,6 +165,21 @@ minetest.register_chatcommand("fly", { end, }) +--[[ + Cancel all active effects +]] +minetest.register_chatcommand("cancelall", { + params = "", + description = "Cancels all your effects.", + privs = {}, + func = function(name, param) + local effects = playereffects.get_player_effects(name) + for e=1, #effects do + playereffects.cancel_effect(effects[e].effect_id) + end + end, +}) + --[[ The stress test applies a shitload of effects at once. This is used to test the performance of this mod at very large effect numbers. ]] minetest.register_chatcommand("stresstest", {