summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHume2 <teratux.mail@gmail.com>2018-09-11 11:28:27 +0200
committerHume2 <teratux.mail@gmail.com>2018-09-11 11:28:27 +0200
commit3e9a039e62a03aea759a961f757c7a62b2af410a (patch)
tree43079e9f7ecf316e59cb38fc85104df315bf2bb5
parentd401328019b0787ad8e87b2c64e705a719856832 (diff)
Add a nil check for data at init.lua:237HEADorigin/masterorigin/HEADmaster
-rw-r--r--init.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 9769bc7..0ec0f76 100644
--- a/init.lua
+++ b/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