diff options
author | Jude Melton-Houghton <jwmhjwmh@gmail.com> | 2022-12-12 08:45:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-12 08:45:09 -0500 |
commit | 1f3b5e553bb581deddf468d62954ff238ebb1ac8 (patch) | |
tree | 23d4f6f510191b05cd4abb445327720b7ee50843 /src/script | |
parent | 981d79157a64468d19f140f5c55d8ccd3855fa71 (diff) | |
download | minetest-1f3b5e553bb581deddf468d62954ff238ebb1ac8.tar.xz |
Fix `plantlike_rooted` world-aligned node base textures (#12994)
Co-authored-by: Wuzzy <Wuzzy@disroot.org>
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/common/c_content.cpp | 13 | ||||
-rw-r--r-- | src/script/common/c_content.h | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index 6203ea78c..4be6457d8 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -462,7 +462,7 @@ void push_object_properties(lua_State *L, ObjectProperties *prop) } /******************************************************************************/ -TileDef read_tiledef(lua_State *L, int index, u8 drawtype) +TileDef read_tiledef(lua_State *L, int index, u8 drawtype, bool special) { if(index < 0) index = lua_gettop(L) + 1 + index; @@ -473,7 +473,6 @@ TileDef read_tiledef(lua_State *L, int index, u8 drawtype) bool default_culling = true; switch (drawtype) { case NDT_PLANTLIKE: - case NDT_PLANTLIKE_ROOTED: case NDT_FIRELIKE: default_tiling = false; // "break" is omitted here intentionaly, as PLANTLIKE @@ -483,6 +482,10 @@ TileDef read_tiledef(lua_State *L, int index, u8 drawtype) case NDT_LIQUID: default_culling = false; break; + case NDT_PLANTLIKE_ROOTED: + default_tiling = !special; + default_culling = !special; + break; default: break; } @@ -576,7 +579,7 @@ void read_content_features(lua_State *L, ContentFeatures &f, int index) int i = 0; while(lua_next(L, table) != 0){ // Read tiledef from value - f.tiledef[i] = read_tiledef(L, -1, f.drawtype); + f.tiledef[i] = read_tiledef(L, -1, f.drawtype, false); // removes value, keeps key for next iteration lua_pop(L, 1); i++; @@ -604,7 +607,7 @@ void read_content_features(lua_State *L, ContentFeatures &f, int index) int i = 0; while (lua_next(L, table) != 0) { // Read tiledef from value - f.tiledef_overlay[i] = read_tiledef(L, -1, f.drawtype); + f.tiledef_overlay[i] = read_tiledef(L, -1, f.drawtype, false); // removes value, keeps key for next iteration lua_pop(L, 1); i++; @@ -632,7 +635,7 @@ void read_content_features(lua_State *L, ContentFeatures &f, int index) int i = 0; while(lua_next(L, table) != 0){ // Read tiledef from value - f.tiledef_special[i] = read_tiledef(L, -1, f.drawtype); + f.tiledef_special[i] = read_tiledef(L, -1, f.drawtype, true); // removes value, keeps key for next iteration lua_pop(L, 1); i++; diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h index aa8746eff..1f8b973b5 100644 --- a/src/script/common/c_content.h +++ b/src/script/common/c_content.h @@ -85,7 +85,7 @@ void push_palette (lua_State *L, const std::vector<video::SColor> *palette); TileDef read_tiledef (lua_State *L, int index, - u8 drawtype); + u8 drawtype, bool special); void read_soundspec (lua_State *L, int index, SimpleSoundSpec &spec); |