summaryrefslogtreecommitdiff
path: root/castle_gates/gate_functions.lua
diff options
context:
space:
mode:
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2019-04-24 18:59:36 -0400
committerVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2019-04-24 18:59:36 -0400
commita5eef1c5de77fa7770877802e66c3e1c53f9a0da (patch)
tree0f36e64a58e5f5bb7d95be6ae692f58f2ebfe483 /castle_gates/gate_functions.lua
parentdda854cf06f90a04a03844e19c4d4ad220e38fe4 (diff)
downloaddreambuilder_modpack-a5eef1c5de77fa7770877802e66c3e1c53f9a0da.tar
dreambuilder_modpack-a5eef1c5de77fa7770877802e66c3e1c53f9a0da.tar.gz
dreambuilder_modpack-a5eef1c5de77fa7770877802e66c3e1c53f9a0da.tar.bz2
dreambuilder_modpack-a5eef1c5de77fa7770877802e66c3e1c53f9a0da.tar.xz
dreambuilder_modpack-a5eef1c5de77fa7770877802e66c3e1c53f9a0da.zip
update castles, areas, homedecor, plantlife,
gloopblocks, hotbar, inspector, maptools, mesecons, moreblocks, moreores, technic, teleport_request, and worldedit switched to caverealms_lite (with minor fixes by me) switched to CWz's fork of player_textures The homedecor update brings in the big split, and will require you to re-enable all modpack components in order to avoid loss of content.
Diffstat (limited to 'castle_gates/gate_functions.lua')
-rw-r--r--castle_gates/gate_functions.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/castle_gates/gate_functions.lua b/castle_gates/gate_functions.lua
index 5d1e6b7..c44cda5 100644
--- a/castle_gates/gate_functions.lua
+++ b/castle_gates/gate_functions.lua
@@ -116,6 +116,8 @@ end
local get_door_layout = function(pos, facedir, player)
+ if facedir > 23 then return nil end -- A bug in another mod once resulted in bad param2s being written to nodes, this will at least prevent crashes if something like that happens again.
+
-- This method does a flood-fill looking for all nodes that meet the following criteria:
-- belongs to a "castle_gate" group
-- has the same "back" direction as the initial node
@@ -153,7 +155,7 @@ local get_door_layout = function(pos, facedir, player)
local test_node_def = minetest.registered_nodes[test_node.name]
can_slide_to:set_pos(test_pos, test_node_def.buildable_to == true)
- if test_node_def.paramtype2 == "facedir" then -- prospective door nodes need to be of type facedir
+ if test_node_def.paramtype2 == "facedir" and test_node.param2 <= 23 then -- prospective door nodes need to be of type facedir and have a valid param2
local test_node_dirs = get_dirs(test_node.param2)
local coplanar = vector.equals(test_node_dirs.back, door.directions.back) -- the "back" vector needs to point in the same direction as the rest of the door