Compare commits
13 Commits
d1acdf3a5b
...
c792c4e9ee
Author | SHA1 | Date |
---|---|---|
teknomunk | c792c4e9ee | |
teknomunk | 1a6a4db770 | |
teknomunk | e341774969 | |
teknomunk | 0f4fd0e276 | |
teknomunk | b7aac6c06e | |
teknomunk | cbf97c228e | |
teknomunk | 6bec2c501f | |
the-real-herowl | c352349931 | |
the-real-herowl | bec4876c64 | |
teknomunk | d841f485f7 | |
the-real-herowl | ea9a6bb737 | |
teknomunk | e924db7b32 | |
teknomunk | c5eb3fa4eb |
|
@ -43,7 +43,7 @@ local arrow_entity = {
|
|||
_fire_damage_resistant = true,
|
||||
|
||||
_save_fields = {
|
||||
"last_pos", "startpos", "damage", "is_critical", "stuck", "stuckin", "stuckin_player", "time_in_air", "vl_projectile",
|
||||
"last_pos", "startpos", "damage", "is_critical", "stuck", "stuckin", "stuckin_player", "time_in_air", "vl_projectile", "collectable"
|
||||
},
|
||||
|
||||
_damage=1, -- Damage on impact
|
||||
|
@ -159,6 +159,9 @@ local arrow_entity = {
|
|||
out[field] = self["_"..field]
|
||||
end
|
||||
|
||||
-- Preserve entity properties
|
||||
out.properties = self.object:get_properties()
|
||||
|
||||
return minetest.serialize(out)
|
||||
end,
|
||||
on_activate = function(self, staticdata, dtime_s)
|
||||
|
@ -168,6 +171,12 @@ local arrow_entity = {
|
|||
local data = minetest.deserialize(staticdata)
|
||||
if not data then return end
|
||||
|
||||
-- Restore entity properties
|
||||
if data.properties then
|
||||
self.object:set_properties(data.properties)
|
||||
data.properties = nil
|
||||
end
|
||||
|
||||
-- Restore arrow state
|
||||
local save_fields = self._save_fields
|
||||
for i = 1,#save_fields do
|
||||
|
|
Loading…
Reference in New Issue