From c0c7024d1b2dc127337ef5588ea04667cf4d6125 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sun, 26 Jan 2020 17:04:50 +0800 Subject: [PATCH] test --- item.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/item.go b/item.go index 840e8f8..8e4c3ee 100644 --- a/item.go +++ b/item.go @@ -354,8 +354,13 @@ func loadObjItem() error { setObjItemCraft(objItems[i].ObjID64, objItems[i].Craft.Command, objItems[i].Craft.Mana) emptyObjItemCraftItem(objItems[i].ObjID64) for k, o := range objItems[i].Craft.Items { - log.Printf("loadObjItem : %s : adding %s (%d) to the recipe.\n", objItems[i].Code, o.Code, o.Quantity) - objItems[i].Craft.Items[k].ItemID64 = getSilentObjItemID(o.Code, ``) + if id, ok := cacheObjItem[objItems[i].Code]; !ok { + log.Printf("loadObjItem : %s : unknown item %s for recipe.\n", objItems[i].Code, o.Code) + } else { + log.Printf("loadObjItem : %s : adding %s (%d) to the recipe.\n", objItems[i].Code, o.Code, o.Quantity) + objItems[i].Craft.Items[k].ItemID64 = objItems[id].ObjID64 + } + } for _, o := range objItems[i].Craft.Items { addObjItemCraftItem(objItems[i].ObjID64, o.ItemID64, o.Quantity)