Project Zomboid

Project Zomboid

Auto Loot B41
Multiplayer bug
Transferring item from nested container is not a supported feature, especially so in MP where client-side and server-side are involved.

In SP, the items get synced immediately, well, because it is SP. In MP, there need to be netcode to support that syncing process but there is no such netcode for nested containers, items in nested containers simply do not sync. The only nested containers that sync is the floor and player's inventory because the square and player object are synced as entire entity.

Anyway, AutoLoot need to check for MP and deny nested containers looting.

I did a quick patch

if not AutoLootShopCompatibilityPatch.oAutoDropLootContainer then AutoLootShopCompatibilityPatch.oAutoDropLootContainer = AutoDrop.LootContainer end function AutoDrop.LootContainer(itemContainer,square,objectSource,playerObj) if itemContainer == nil then return end if getActivatedMods():contains("nshops") and itemContainer:getType() == "crate" then if itemContainer:getParent():getSprite():getName():find("playershop_", 1, true) then return false end end if isClient() and not instanceof(itemContainer:getParent(), "IsoObject") then if itemContainer:getContainingItem():getContainer() then if itemContainer:getContainingItem():getContainer():getType() ~= "floor"then return false end end end return AutoLootShopCompatibilityPatch.oAutoDropLootContainer(itemContainer,square,objectSource,playerObj) end

The same need to done for
local function autoDropContainer(itemContainer,square,objectSource,playerObj)

Did be nice if autoDropContainer is global so I can decorate it. I had to override all related functions just to do a quick patch. Geez.

And yes, I also have a nshops mod compatibility patch in it.
Last edited by Lu5ck; 6 Aug @ 7:28am