Allow painting coupled wagons

This commit is contained in:
Gabriel Pérez-Cerezo 2019-12-01 12:25:06 +01:00
parent 0518fbbf3a
commit 25a335203f
1 changed files with 4 additions and 4 deletions

View File

@ -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