* Simplify photo meta (wield image falls back to inventory image)

This commit is contained in:
Nils Dagsson Moskopp 2023-11-08 19:55:43 +01:00
parent c84edc1345
commit f3ac2bde3e
Signed by: erle
GPG Key ID: A3BC671C35191080
1 changed files with 2 additions and 10 deletions

View File

@ -22,17 +22,9 @@ local create_photo_item = function( pixels )
local image = tga_encoder.image( pixels )
image:encode()
local texture_string = "[png:" .. minetest.encode_base64( image.data )
meta:set_string(
"xcam:texture",
texture_string
)
meta:set_string(
"inventory_image",
"${xcam:texture}"
)
meta:set_string(
"wield_image",
"${xcam:texture}"
texture_string
)
return itemstack
@ -252,7 +244,7 @@ minetest.register_entity(
assert( self._itemstring )
local itemstack = ItemStack(self._itemstring)
local meta = itemstack:get_meta()
local texture = meta:get_string("xcam:texture")
local texture = meta:get_string("inventory_image")
self.object:set_properties({
selectionbox = sbox,