Add a nil check for data at init.lua:237
This commit is contained in:
parent
d401328019
commit
3e9a039e62
8
init.lua
8
init.lua
@ -234,9 +234,11 @@ function bike.on_activate(self, staticdata, dtime_s)
|
||||
self.object:set_armor_groups({immortal = 1})
|
||||
if staticdata ~= "" then
|
||||
local data = minetest.deserialize(staticdata)
|
||||
self.v = data.v
|
||||
self.color = data.color
|
||||
self.alpha = data.alpha
|
||||
if data ~= nil then
|
||||
self.v = data.v
|
||||
self.color = data.color
|
||||
self.alpha = data.alpha
|
||||
end
|
||||
end
|
||||
self.object:set_properties({textures=default_tex(self.color, self.alpha)})
|
||||
self.last_v = self.v
|
||||
|
Loading…
x
Reference in New Issue
Block a user