Fix camera MaterialItem draw logic
authorPerttu Ahola <celeron55@gmail.com>
Wed, 16 Nov 2011 12:48:05 +0000 (14:48 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 29 Nov 2011 17:13:47 +0000 (19:13 +0200)
src/camera.cpp

index 938c7a5ce52732bed015b389042091b73b8d49d2..54b3326fa73da203666b54da9285ddf33f0e67df 100644 (file)
@@ -464,11 +464,19 @@ void Camera::wield(const InventoryItem* item, IGameDef *gamedef)
                        // A block-type material
                        MaterialItem* mat_item = (MaterialItem*) item;
                        content_t content = mat_item->getMaterial();
-                       if (ndef->get(content).solidness || ndef->get(content).visual_solidness)
-                       {
+                       switch(ndef->get(content).drawtype){
+                       case NDT_NORMAL:
+                       case NDT_LIQUID:
+                       case NDT_FLOWINGLIQUID:
+                       case NDT_GLASSLIKE:
+                       case NDT_ALLFACES:
+                       case NDT_ALLFACES_OPTIONAL:
                                m_wieldnode->setCube(ndef->get(content).tiles);
                                m_wieldnode->setScale(v3f(30));
                                isCube = true;
+                               break;
+                       default:
+                               break;
                        }
                }