aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-12-01 12:25:06 +0100
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-12-01 12:25:06 +0100
commit25a335203f81fb80effed30f74aed2ed7d488837 (patch)
treefd24381e68e04b3193b13741bf4cfc8809086d65
parent0518fbbf3ae388631cb21f238068f2a6b3785972 (diff)
downloadadvtrains-25a335203f81fb80effed30f74aed2ed7d488837.tar.gz
advtrains-25a335203f81fb80effed30f74aed2ed7d488837.tar.bz2
advtrains-25a335203f81fb80effed30f74aed2ed7d488837.zip
Allow painting coupled wagons
-rw-r--r--advtrains/wagons.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index 4dbe85c..040c1e4 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -173,10 +173,6 @@ function wagon:on_punch(puncher, time_from_last_punch, tool_capabilities, direct
minetest.chat_send_player(puncher:get_player_name(), attrans("This wagon is owned by @1, you can't destroy it.", data.owner));
return
end
- if #(self:train().trainparts)>1 then
- minetest.chat_send_player(puncher:get_player_name(), attrans("Wagon needs to be decoupled from other wagons in order to destroy it."));
- return
- end
if self.custom_may_destroy then
if not self.custom_may_destroy(self, puncher, time_from_last_punch, tool_capabilities, direction) then
@@ -189,6 +185,10 @@ function wagon:on_punch(puncher, time_from_last_punch, tool_capabilities, direct
self:set_livery(puncher, itemstack, data)
return
end
+ if #(self:train().trainparts)>1 then
+ minetest.chat_send_player(puncher:get_player_name(), attrans("Wagon needs to be decoupled from other wagons in order to destroy it."));
+ return
+ end
local pc=puncher:get_player_control()
if not pc.sneak then