fixed animation issue, fixed problem with inventory property changes

This commit is contained in:
FatalErr42O 2025-01-03 16:50:57 -08:00
parent fe7313975f
commit 1833fa18c7
2 changed files with 3 additions and 2 deletions

View File

@ -82,6 +82,7 @@ local function initialize_animation_tracking_data(self)
frames = {x=0,y=0}, frames = {x=0,y=0},
current_frame = 0, current_frame = 0,
} }
self:clear_animation()
self.player_rotation = vector.new(self.properties.initial_vertical_rotation,0,0) self.player_rotation = vector.new(self.properties.initial_vertical_rotation,0,0)
self.animation_rotation = vector.new() self.animation_rotation = vector.new()
self.animation_translation = vector.new() self.animation_translation = vector.new()
@ -260,7 +261,7 @@ local function reregister_item(self, props)
local old_on_use = item_def.on_use local old_on_use = item_def.on_use
local old_on_s_use = item_def.on_secondary_use local old_on_s_use = item_def.on_secondary_use
local old_on_drop = item_def.on_drop local old_on_drop = item_def.on_drop
self.properties.inventory_image = item_def.inventory_image self.properties.inventory.inventory_image = item_def.inventory_image
--override the item to hook in controls. (on_drop needed) --override the item to hook in controls. (on_drop needed)
minetest.override_item(self.itemstring, { minetest.override_item(self.itemstring, {
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)

View File

@ -155,7 +155,7 @@ local gun_default = {
}, },
--- `string` (optional) inventory image for when the gun has no magazine --- `string` (optional) inventory image for when the gun has no magazine
inventory_image_magless = nil, inventory_image_magless = nil,
--- `string` inventory image for when the gun is loaded. This is added automatically during construction. --- `string` inventory image for when the gun is loaded. This is added automatically during construction as the item's wield image.
inventory_image = nil, inventory_image = nil,
--[[part_slots = { --[[part_slots = {
underbarrel = { underbarrel = {