diff options
author | kwolekr <kwolekr@minetest.net> | 2014-12-06 18:39:05 -0500 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2014-12-06 18:39:05 -0500 |
commit | 390c0cd69185b3be7f6f49d7f8fe53f901edf5aa (patch) | |
tree | f2ebb02cac0a77585c04e3b672d11c47d9a66d4c /src/script/common | |
parent | 60feb4ad25003b4ed5f93f7fda7f4b8177a0ba51 (diff) | |
download | minetest-390c0cd69185b3be7f6f49d7f8fe53f901edf5aa.tar.gz minetest-390c0cd69185b3be7f6f49d7f8fe53f901edf5aa.tar.bz2 minetest-390c0cd69185b3be7f6f49d7f8fe53f901edf5aa.zip |
Schematics: Fix minetest.place_schematic() when defined by a Lua table
Diffstat (limited to 'src/script/common')
-rw-r--r-- | src/script/common/c_content.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index bf4da41ec..799251bcf 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -267,7 +267,7 @@ ContentFeatures read_content_features(lua_State *L, int index) lua_getfield(L, index, "on_rightclick"); f.rightclickable = lua_isfunction(L, -1); lua_pop(L, 1); - + /* Name */ getstringfield(L, index, "name", f.name); @@ -1039,7 +1039,7 @@ bool read_schematic(lua_State *L, int index, Schematic *schem, //// Get schematic data lua_getfield(L, index, "data"); luaL_checktype(L, -1, LUA_TTABLE); - + int numnodes = size.X * size.Y * size.Z; MapNode *schemdata = new MapNode[numnodes]; int i = 0; @@ -1069,7 +1069,7 @@ bool read_schematic(lua_State *L, int index, Schematic *schem, schemdata[i] = MapNode(ndef, name, param1, param2); } - + i++; lua_pop(L, 1); } @@ -1098,7 +1098,10 @@ bool read_schematic(lua_State *L, int index, Schematic *schem, } } - schem->flags = 0; + // Here, we read the nodes directly from the INodeDefManager - there is no + // need for pending node resolutions so we'll mark this schematic as updated + schem->flags = SCHEM_CIDS_UPDATED; + schem->size = size; schem->schemdata = schemdata; schem->slice_probs = slice_probs; |