From ce0279ce3b26571649b92fe9d5bd2a5fe6eda43c Mon Sep 17 00:00:00 2001 From: chotgpt Date: Tue, 7 Jul 2026 10:15:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9F=BA=E7=A1=80=E5=BA=93=E9=80=82?= =?UTF-8?q?=E9=85=8D=E7=BC=98=E8=B5=B7=E5=AE=A2=E6=88=B7=E7=AB=AF=E6=8B=BE?= =?UTF-8?q?=E5=8F=96=E6=8E=A5=E5=8F=A3=E7=94=B1=20doodad=20=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=E8=87=B3=20scene?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MY_!Base/src/lib/Game.Target.Doodad.lua | 36 ++++++++++++++++--------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/MY_!Base/src/lib/Game.Target.Doodad.lua b/MY_!Base/src/lib/Game.Target.Doodad.lua index db1f232b8..1d209b28e 100644 --- a/MY_!Base/src/lib/Game.Target.Doodad.lua +++ b/MY_!Base/src/lib/Game.Target.Doodad.lua @@ -46,8 +46,9 @@ function X.GetDoodadLootMoney(dwDoodadID) local scene = me and me.GetScene() return scene and scene.GetLootMoney(dwDoodadID) else - local doodad = X.GetDoodad(dwDoodadID) - return doodad and doodad.GetLootMoney() + local me = X.GetClientPlayer() + local scene = me and me.GetScene() + return scene and scene.GetLootMoney(dwDoodadID) end end @@ -61,8 +62,10 @@ function X.GetDoodadLootItemCount(dwDoodadID) local tLoot = scene and scene.GetLootList(dwDoodadID) return tLoot and tLoot.nItemCount or nil else - local doodad = X.GetDoodad(dwDoodadID) - return doodad and doodad.GetItemListCount() + local me = X.GetClientPlayer() + local scene = me and me.GetScene() + local tLoot = scene and scene.GetLootList(dwDoodadID) + return tLoot and tLoot.nItemCount or nil end end @@ -83,9 +86,14 @@ function X.GetDoodadLootItem(dwDoodadID, nIndex) end else local me = X.GetClientPlayer() - local doodad = X.GetDoodad(dwDoodadID) - if doodad then - return doodad.GetLootItem(nIndex - 1, me) + local scene = me and me.GetScene() + local tLoot = scene and scene.GetLootList(dwDoodadID) + local it = tLoot and tLoot[nIndex - 1] + if it then + local bNeedRoll = it.LootType == X.CONSTANT.LOOT_ITEM_TYPE.NEED_ROLL + local bDist = it.LootType == X.CONSTANT.LOOT_ITEM_TYPE.NEED_DISTRIBUTE + local bBidding = it.LootType == X.CONSTANT.LOOT_ITEM_TYPE.NEED_BIDDING + return it.Item, bNeedRoll, bDist, bBidding end end end @@ -102,9 +110,10 @@ function X.DistributeDoodadItem(dwDoodadID, dwItemID, dwTargetPlayerID) scene.DistributeItem(dwDoodadID, dwItemID, dwTargetPlayerID) end else - local doodad = X.GetDoodad(dwDoodadID) - if doodad then - doodad.DistributeItem(dwItemID, dwTargetPlayerID) + local me = X.GetClientPlayer() + local scene = me and me.GetScene() + if scene then + scene.DistributeItem(dwDoodadID, dwItemID, dwTargetPlayerID) end end end @@ -120,9 +129,10 @@ function X.GetDoodadLooterList(dwDoodadID) return scene.GetLooterList(dwDoodadID) end else - local doodad = X.GetDoodad(dwDoodadID) - if doodad then - return doodad.GetLooterList() + local me = X.GetClientPlayer() + local scene = me and me.GetScene() + if scene then + return scene.GetLooterList(dwDoodadID) end end end