From b89eb605b7020998fbf5d7142033ceb5275b3f71 Mon Sep 17 00:00:00 2001 From: Jude Melton-Houghton Date: Wed, 16 Nov 2022 13:11:36 -0500 Subject: [PATCH] Warn about potential infinite loop in on_construct (#12967) Co-authored-by: sfan5 --- doc/lua_api.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 3ac530dd4..b576863d6 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -8482,6 +8482,9 @@ Used by `minetest.register_node`. -- Node constructor; called after adding node. -- Can set up metadata and stuff like that. -- Not called for bulk node placement (i.e. schematics and VoxelManip). + -- Note: Within an on_construct callback, minetest.set_node can cause an + -- infinite loop if it invokes the same callback. + -- Consider using minetest.swap_node instead. -- default: nil on_destruct = function(pos),