forked from VoxeLibre/VoxeLibre
Simplify 3D wielded nodes (improves performance + possibly fixes a crash)
This commit is contained in:
parent
a5168721b1
commit
d4401a6c3e
|
@ -105,15 +105,14 @@ minetest.register_entity("wieldview:wieldnode", {
|
||||||
local player = minetest.get_player_by_name(self.wielder)
|
local player = minetest.get_player_by_name(self.wielder)
|
||||||
if player then
|
if player then
|
||||||
local wielded = player:get_wielded_item()
|
local wielded = player:get_wielded_item()
|
||||||
local itemstring = wielded:to_string()
|
local itemstring = wielded:get_name()
|
||||||
if self.itemstring ~= itemstring then
|
if self.itemstring ~= itemstring then
|
||||||
local itemname = wielded:get_name()
|
local def = minetest.registered_items[itemstring]
|
||||||
local def = minetest.registered_items[itemname]
|
|
||||||
self.object:set_properties({glow = def and def.light_source or 0})
|
self.object:set_properties({glow = def and def.light_source or 0})
|
||||||
if armor.textures[self.wielder].wielditem == "blank.png" then
|
if armor.textures[self.wielder].wielditem == "blank.png" then
|
||||||
self.object:set_properties({textures = {itemname}, wield_item = itemstring})
|
self.object:set_properties({textures = {itemstring}})
|
||||||
else
|
else
|
||||||
self.object:set_properties({textures = {""}, wield_item = ""})
|
self.object:set_properties({textures = {""}})
|
||||||
end
|
end
|
||||||
self.itemstring = itemstring
|
self.itemstring = itemstring
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue