From 7ba5ec47e6d78aa2133476f3f3221df5aed80ede Mon Sep 17 00:00:00 2001 From: Durel Date: Sun, 8 Apr 2018 15:31:13 -0400 Subject: [PATCH] 1) Dinv will no longer attempt to identify items in a container if the container is owned by another player. The previous dinv version could generate a lot of warnings if you ran a refresh while holding someone else's container (e.g., from a CR). --- aard_inventory.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aard_inventory.xml b/aard_inventory.xml index 593e148..b7928e1 100644 --- a/aard_inventory.xml +++ b/aard_inventory.xml @@ -5969,8 +5969,12 @@ function inv.items.discoverCR(maxNumItems, refreshLocations) -- Discover all containers if (refreshLocation == invItemsRefreshLocAll) or (refreshLocation == invItemsRefreshLocDirty) then for objId,v in pairs(inv.items.table) do + local itemOwner, pretitle = dbot.gmcp.getName() - if (inv.items.getStatField(objId, invStatFieldType) == invmon.typeStr[invmonTypeContainer]) then + -- If this is a container that we own, try to discover everything in it. Don't try to discover + -- items if we don't own the container because we can't access it anyway. + if (inv.items.getStatField(objId, invStatFieldType) == invmon.typeStr[invmonTypeContainer]) and + (inv.items.getStatField(objId, invStatFieldOwnedBy) == itemOwner) then -- Scan this container if the caller asked us to scan everything or if we need to scan all -- dirty containers and this container is dirty (i.e., it hasn't been verified to be clean @@ -19280,6 +19284,7 @@ end -- dbot.error -- -- dbot.gmcp.getArea -- dbot.gmcp.getClass +-- dbot.gmcp.getName -- dbot.gmcp.getLevel -- dbot.gmcp.getAlign -- dbot.gmcp.getRoomId