Try to fix occasional crash when placing wagons

master
orwell96 2017-12-17 13:21:56 +01:00 committed by GitHub
parent 875eb90acb
commit ae3452a39c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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