From 17ee62dc643ccc568920697cec3786d2c0eb82ec Mon Sep 17 00:00:00 2001 From: orwell96 Date: Tue, 14 Nov 2017 22:08:56 +0100 Subject: Fix occasional crash in discouple on_punch I think the issue is caused by the new animal damage code... --- advtrains/couple.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'advtrains/couple.lua') diff --git a/advtrains/couple.lua b/advtrains/couple.lua index 6741de8..9bc0fd5 100644 --- a/advtrains/couple.lua +++ b/advtrains/couple.lua @@ -32,6 +32,10 @@ minetest.register_entity("advtrains:discouple", { get_staticdata=function() return "DISCOUPLE" end, on_punch=function(self, player) return advtrains.pcall(function() + if not self.wagon or not player or player:get_player_name()=="" then + --our new animal damage code seems to generate problems + return + end --only if player owns at least one wagon next to this local own=player:get_player_name() if self.wagon.owner and self.wagon.owner==own and not self.wagon.lock_couples then -- cgit v1.2.3