Project Zomboid

Project Zomboid

Push From Ground
Reifel 9 Jan, 2023 @ 3:07pm
i fix the trunk stuck if too heavy and create an standalone mod for wooden wheelbarrow
standalone mod wooden wheelbarrow
github-zip-download [github.com]

video showing the bug issue
https://www.youtube.com/watch?v=w1RhFGQgwjs&t=231s

--last line of PFG.lua PFGMenu.addInventoryContext = function(player,context,inventoryObjects) local pzPlayer = getSpecificPlayer(player) local playerInventory = pzPlayer:getInventory() local items = inventoryObjects for i,v in pairs(items) do local p, j = i, v if v.cat == "Container" then --dont show push inside player inventory if playerInventory:contains(v.items) then return end

local itemClicked = v.items:getItemContainer()

local type = itemClicked:getType()
for ti,tv in ipairs(PFGMenu.typesTable) do
if tv == type then
local selectOption = context:addOption("Push Cart",v.items,PFGMenu.pushCart,player,v.items)
end
end
end
end

end

PFGMenu.pushCart = function(worldobjects,player,item)
local pzPlayer = getSpecificPlayer(player)


--if on floor
if item:getWorldItem() then
PFGMenu.equipCart(worldobjects,player,item:getWorldItem())
else
--if inside trunk FIX BUG CANT GET BACK FROM TRUNK IF TOO HEAVY
ISTimedActionQueue.add(ISEquipHeavyItem:new(pzPlayer, item, 50))
end


end

Events.OnPreFillInventoryObjectContextMenu.Add(PFGMenu.addInventoryContext)
Last edited by Reifel; 9 Jan, 2023 @ 4:10pm