player_api/mods
Auke Kok 41c2b2aeea Allow both sides of the bed to be digged up.
Tested with nodebreaker, fire.

If called from lua, minetest.remove_node() calls on_destruct() callbacks
before the map is actually updated. This means that we can't look at the
map data to determine if we're done cleaning up adjacent nodes, and we
have to stop recursing some other way.

There's no data we can pass around through functions that would survive
scope to a secondary on_destruct() callback, so we have to maintain
local state somewhere in the mod namespace.

In this case, we keep a bitflag. The bitflag is set to "true" by
default. On the first half removal, the flag is flipped and afterwards
we remove the other half node. When the on_destruct for the other half
is running, it's value is false and we flip it back to true without
removing the other half node.

This thus prevents recursing.

To facilitate easier finding of the bed partner, we tell our on_destruct
whether we're a top or bottom half node through a passed flag.

Now that the top is diggable, we just need to assure that it drops a
bottom bed part.
2016-03-18 02:35:07 +00:00
..
beds Allow both sides of the bed to be digged up. 2016-03-18 02:35:07 +00:00
boats Follow naming conventions of textures and models in boats 2016-02-03 19:33:46 +00:00
bones Add "protection_bypass" priv. 2016-03-13 04:48:57 +00:00
bucket Rename to Minetest Game 2015-09-30 23:33:12 +01:00
creative Creative: Rename fields with correct naming convention to avoid possible conflicts 2016-02-21 15:31:37 +00:00
default Default: Colourise desert cobble to be consistent with desert stone 2016-03-15 16:23:13 +00:00
doors Add steel door/trapdoor sounds. 2016-03-18 02:34:43 +00:00
dye Dye: Add global table of dye names and descriptions 2016-03-13 04:49:03 +00:00
farming Consolidate ABMs 2016-02-14 05:22:20 +00:00
fire Fire: Optimize spreading ABM. 2016-03-15 16:22:50 +00:00
flowers Consolidate ABMs 2016-02-14 05:22:20 +00:00
give_initial_stuff Remove / replace all print() calls 2013-11-17 11:55:46 +01:00
screwdriver Fix bug rotating unknown node 2016-03-13 04:49:15 +00:00
sethome Fix some undeclared global variables 2014-11-30 18:02:33 +01:00
stairs Consolidate ABMs 2016-02-14 05:22:20 +00:00
tnt added timer to tnt:tnt_burning for explosions 2016-02-18 13:56:57 +00:00
vessels Rename to Minetest Game 2015-09-30 23:33:12 +01:00
walls Basic stone walls, using NDT_CONNECTED. 2016-03-13 04:11:22 +00:00
wool ability to dye coloured wool white 2016-01-29 03:50:07 +00:00
xpanes Add steel ladder 2016-03-06 01:31:36 +00:00