Skip to content

Instantly share code, notes, and snippets.

@sofar
Created January 17, 2016 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sofar/363ea387e054f88c2b0c to your computer and use it in GitHub Desktop.
Save sofar/363ea387e054f88c2b0c to your computer and use it in GitHub Desktop.
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index 2ebe1c1..110ac93 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -909,7 +909,6 @@ void CNodeDefManager::updateTextures(IGameDef *gamedef,
break;
case NDT_MESH:
f->solidness = 0;
- f->backface_culling = false;
break;
case NDT_TORCHLIKE:
case NDT_SIGNLIKE:
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index 62de2c9..3d21032 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -367,6 +367,12 @@ ContentFeatures read_content_features(lua_State *L, int index)
f.drawtype = (NodeDrawType)getenumfield(L, index, "drawtype",
ScriptApiNode::es_DrawType,NDT_NORMAL);
+
+ /* disable backface culling by default for mesh nodes */
+ if (f.drawtype == NDT_MESH)
+ f.backface_culling = false;
+ getboolfield(L, index, "backface_culling", f.backface_culling);
+
getfloatfield(L, index, "visual_scale", f.visual_scale);
/* Meshnode model filename */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment