This commit is contained in:
ZioPao
2024-03-19 12:25:19 +01:00
parent 95f1aa304e
commit 6c5276aff2
2 changed files with 22 additions and 161 deletions

View File

@@ -105,14 +105,16 @@ ItemsController.Zombie = {}
---@param amputationFullType string Full Type
function ItemsController.Zombie.SpawnAmputationItem(zombie, amputationFullType)
local texId = ItemsController.Zombie.GetAmputationTexturesIndex(zombie)
local zombieVisuals = zombie:getItemVisuals()
local itemVisual = ItemVisual:new()
itemVisual:setItemType(amputationFullType)
itemVisual:setTextureChoice(texId)
local clothingItem = zombie:getInventory():AddItem(amputationFullType)
zombie:setWornItem(clothingItem:getBodyLocation(), clothingItem)
zombie:getItemVisuals():add(itemVisual)
zombieVisuals:add(itemVisual)
zombie:resetModelNextFrame()
-- Spawn the item too in the inventory to keep track of stuff this way. It's gonna get deleted when we reload the game
local zombieInv = zombie:getInventory()
zombieInv:AddItem(amputationFullType)
end
function ItemsController.Zombie.GetAmputationTexturesIndex(zombie)