diff options
author | orwell96 <mono96.mml@gmail.com> | 2017-11-14 22:08:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-14 22:08:56 +0100 |
commit | 17ee62dc643ccc568920697cec3786d2c0eb82ec (patch) | |
tree | f8a07ae8698cfc793ae7fb7c65d81141a4f9fd0c /advtrains/couple.lua | |
parent | 480011c7813fee5033c3c6c99b38cde8ef1b4350 (diff) | |
download | advtrains-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/couple.lua')
-rw-r--r-- | advtrains/couple.lua | 4 |
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 |