Duplicate last tile image automatically to all for lua node definitions
authorPerttu Ahola <celeron55@gmail.com>
Fri, 25 Nov 2011 16:57:17 +0000 (18:57 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 29 Nov 2011 17:13:51 +0000 (19:13 +0200)
src/scriptapi.cpp

index 6f16c72e7aeea54e20b35fedf1704fef0bedfe47..5ef4f9972fab5a8670970e642b78b3f7999e3c02 100644 (file)
@@ -529,6 +529,14 @@ static int l_register_node(lua_State *L)
                                break;
                        }
                }
+               // Copy last value to all remaining textures
+               if(i >= 1){
+                       std::string lastname = f.tname_tiles[i-1];
+                       while(i < 6){
+                               f.tname_tiles[i] = lastname;
+                               i++;
+                       }
+               }
        }
        lua_pop(L, 1);