From ae3452a39c1da11860c44b2a3fe6dc98c7420e90 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Sun, 17 Dec 2017 13:21:56 +0100 Subject: Try to fix occasional crash when placing wagons --- advtrains_train_subway/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/advtrains_train_subway/init.lua b/advtrains_train_subway/init.lua index f8e5e3b..9dd6f28 100644 --- a/advtrains_train_subway/init.lua +++ b/advtrains_train_subway/init.lua @@ -77,6 +77,7 @@ advtrains.register_wagon("subway_wagon", { drops={"default:steelblock 4"}, horn_sound = "advtrains_subway_horn", custom_on_velocity_change = function(self, velocity, old_velocity) + if not velocity or not old_velocity then return end if old_velocity == 0 and velocity > 0 then minetest.sound_play("advtrains_subway_depart", {object = self.object}) end -- cgit v1.2.3