Fix crash

IDK why this happens, but it's not important.
master
orwell96 2018-01-17 20:15:06 +01:00 committed by GitHub
parent fa7f05fd0c
commit 8ef6e9a529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ minetest.register_entity("advtrains:discouple", {
self.object:remove()
return
end
if self.wagon.old_velocity > 0 or self.wagon.pos_in_trainparts==1 then
if (self.wagon.old_velocity and self.wagon.old_velocity > 0) or self.wagon.pos_in_trainparts==1 then
self.object:remove()
end
atprintbm("discouple_step", t)