aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2017-11-14 22:08:56 +0100
committerGitHub <noreply@github.com>2017-11-14 22:08:56 +0100
commit17ee62dc643ccc568920697cec3786d2c0eb82ec (patch)
treef8a07ae8698cfc793ae7fb7c65d81141a4f9fd0c /advtrains
parent480011c7813fee5033c3c6c99b38cde8ef1b4350 (diff)
downloadadvtrains-17ee62dc643ccc568920697cec3786d2c0eb82ec.tar.gz
advtrains-17ee62dc643ccc568920697cec3786d2c0eb82ec.tar.bz2
advtrains-17ee62dc643ccc568920697cec3786d2c0eb82ec.zip
Fix occasional crash in discouple on_punch
I think the issue is caused by the new animal damage code...
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/couple.lua4
1 files changed, 4 insertions, 0 deletions
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