aboutsummaryrefslogtreecommitdiff
path: root/couple.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2016-08-28 22:05:35 +0200
committerorwell96 <mono96.mml@gmail.com>2016-08-28 22:05:35 +0200
commit0db3276a25d80ee42cfca2c7aec95fc6a7657b7d (patch)
tree059b3e4819327dbacea8199afc1098101a732049 /couple.lua
parent0a5630011de05e04d0040091137b2a8d27a3536f (diff)
downloadadvtrains-0db3276a25d80ee42cfca2c7aec95fc6a7657b7d.tar.gz
advtrains-0db3276a25d80ee42cfca2c7aec95fc6a7657b7d.tar.bz2
advtrains-0db3276a25d80ee42cfca2c7aec95fc6a7657b7d.zip
correcting an error that caused a crash
Diffstat (limited to 'couple.lua')
-rw-r--r--couple.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/couple.lua b/couple.lua
index eae5e1c..5e6d81b 100644
--- a/couple.lua
+++ b/couple.lua
@@ -35,10 +35,12 @@ minetest.register_entity("advtrains:discouple", {
local t=os.clock()
if not self.wagon then
self.object:remove()
+ return
end
--getyaw seems to be a reliable method to check if an object is loaded...if it returns nil, it is not.
if not self.wagon.object:getyaw() then
self.object:remove()
+ return
end
local velocityvec=self.wagon.object:getvelocity()
self.updatepct_timer=(self.updatepct_timer or 0)-dtime