]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/mapnode.h
Remove stuff made obsolete by making players more ActiveObject-like and raise protoco...
[dragonfireclient.git] / src / mapnode.h
index 285f197db995bd7a47dac0783b79736808e29d9e..65fc3b3e29566394a31c58fa75d3be6bde212f7e 100644 (file)
@@ -147,6 +147,11 @@ struct MapNode
                // because this needs to override part of param2
                setContent(content);
        }
+       
+       // Create directly from a nodename
+       // If name is unknown, sets CONTENT_IGNORE
+       MapNode(INodeDefManager *ndef, const std::string &name,
+                       u8 a_param1=0, u8 a_param2=0);
 
        bool operator==(const MapNode &other)
        {
@@ -178,6 +183,30 @@ struct MapNode
                        param2 |= (c&0x0f)<<4;
                }
        }
+       u8 getParam1() const
+       {
+               return param1;
+       }
+       void setParam1(u8 p)
+       {
+               param1 = p;
+       }
+       u8 getParam2() const
+       {
+               if(param0 < 0x80)
+                       return param2;
+               else
+                       return param2 & 0x0f;
+       }
+       void setParam2(u8 p)
+       {
+               if(param0 < 0x80)
+                       param2 = p;
+               else{
+                       param2 &= 0xf0;
+                       param2 |= (p&0x0f);
+               }
+       }
        
        void setLight(enum LightBank bank, u8 a_light, INodeDefManager *nodemgr);
        u8 getLight(enum LightBank bank, INodeDefManager *nodemgr) const;