Jump to content

[Re-report] Inventory:GiveItem can generate garbage at 000


Littlefat1213
  • Fixed

 
function Inventory:GiveItem(inst, slot, src_pos)
  ......
  	else	-- should consider the case that stacksize can exceed the maxsize after the stack combination
        if self.activeitem and self.activeitem ~= inst and
            self.activeitem.components.stackable and
            inst.components.stackable and
            self.activeitem.prefab == inst.prefab and
            self.activeitem.skinname == inst.skinname and
            not self.activeitem.components.stackable:IsFull()
            then
            self.activeitem.components.stackable:Put(inst, Vector3(self.inst.Transform:GetWorldPosition()))
            self.inst:PushEvent("gotnewitem", { item = inst, toactiveitem = true, })
            returnvalue = true
            shouldwisecrack = false
        else
            self:DropItem(inst, true, true)
        end
    end
  
end

Note: Make sure your inventory is full.

Crafting or picking up product that exceeds your active item slot could genernate the leftovers at the previous position

(could be 0,0,0 if the leftovers spawned without set world position)


Steps to Reproduce

As Above

  • Like 1



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...