Fix occasional crash in discouple on_punch
I think the issue is caused by the new animal damage code...master
parent
480011c781
commit
17ee62dc64
|
@ -32,6 +32,10 @@ minetest.register_entity("advtrains:discouple", {
|
||||||
get_staticdata=function() return "DISCOUPLE" end,
|
get_staticdata=function() return "DISCOUPLE" end,
|
||||||
on_punch=function(self, player)
|
on_punch=function(self, player)
|
||||||
return advtrains.pcall(function()
|
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
|
--only if player owns at least one wagon next to this
|
||||||
local own=player:get_player_name()
|
local own=player:get_player_name()
|
||||||
if self.wagon.owner and self.wagon.owner==own and not self.wagon.lock_couples then
|
if self.wagon.owner and self.wagon.owner==own and not self.wagon.lock_couples then
|
||||||
|
|
Loading…
Reference in New Issue