]> git.lizzy.rs Git - minetest.git/blobdiff - src/mapnode.cpp
Use numeric indices and raw table access with LUA_REGISTRYINDEX
[minetest.git] / src / mapnode.cpp
index 4afa91983b19917b8f2db9d7888f7838ce45dc52..732237833c4e391abb5d7281824e1fd09a141d62 100644 (file)
@@ -163,6 +163,9 @@ void MapNode::rotateAlongYAxis(INodeDefManager *nodemgr, Rotation rot) {
        ContentParamType2 cpt2 = nodemgr->get(*this).param_type_2;
 
        if (cpt2 == CPT2_FACEDIR) {
+               if (param2 >= 4)
+                       return;
+
                u8 newrot = param2 & 3;
                param2 &= ~3;
                param2 |= (newrot + rot) & 3;
@@ -189,7 +192,7 @@ static std::vector<aabb3f> transformNodeBox(const MapNode &n,
                facedir&=0x03;
                for(std::vector<aabb3f>::const_iterator
                                i = fixed.begin();
-                               i != fixed.end(); i++)
+                               i != fixed.end(); ++i)
                {
                        aabb3f box = *i;