diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2021-02-16 18:13:03 +0100 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2021-02-16 18:13:03 +0100 |
commit | 501d222d5c32ecac287a4c016a9107dee4822b16 (patch) | |
tree | 2fba83f91f77edd9256efb50bc145604b11d369b | |
parent | 74f0c88d809d91e4cc54eb1275c7833653bc45cc (diff) | |
download | moretrains-501d222d5c32ecac287a4c016a9107dee4822b16.tar.gz moretrains-501d222d5c32ecac287a4c016a9107dee4822b16.tar.bz2 moretrains-501d222d5c32ecac287a4c016a9107dee4822b16.zip |
fix bug
-rw-r--r-- | moretrains_gondola/init.lua | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/moretrains_gondola/init.lua b/moretrains_gondola/init.lua index e8636a1..393ce65 100644 --- a/moretrains_gondola/init.lua +++ b/moretrains_gondola/init.lua @@ -7,7 +7,7 @@ end local function escape_texture(str) - return str:gsub("\\[", "\\["):gsub(":", "\\:"):gsub("[\\^]", "\\^") + return str:gsub("[\\[]", "\\["):gsub(":", "\\:"):gsub("[\\^]", "\\^") end local function set_textures(self, data) @@ -33,24 +33,25 @@ local function set_textures(self, data) mesh="moretrains_gondola_mese.b3d", textures={"[combine:256x256:0,0=moretrains_wagon_gondola_cobble.png:0,109="..escape_texture(texture).."\\^\\[resize\\:16x16"} }) + return end + end + local idef = minetest.registered_items[name] + if idef and idef.groups.advtrains_trackplacer and idef.groups.advtrains_trackplacer > 0 then + self.object:set_properties({ + mesh="moretrains_gondola_rails.b3d", + textures = {"moretrains_wagon_gondola.png"}, + }) else - local idef = minetest.registered_items[name] - if idef and idef.groups.advtrains_trackplacer and idef.groups.advtrains_trackplacer > 0 then - self.object:set_properties({ - mesh="moretrains_gondola_rails.b3d", - textures = {"moretrains_wagon_gondola.png"}, - }) - else - self.object:set_properties({ - mesh="moretrains_gondola_toiletpaper.b3d", - textures = {"moretrains_wagon_gondola.png"}, - }) - end - end - end + self.object:set_properties({ + mesh="moretrains_gondola_toiletpaper.b3d", + textures = {"moretrains_wagon_gondola.png"}, + }) + end + end end + local function convert(self, dtime, data, train) data.type = "advtrains:moretrains_wagon_gondola" end |