lzx преди 2 дни
родител
ревизия
e0fb04a42e
променени са 1 файла, в които са добавени 10 реда и са изтрити 8 реда
  1. 10 8
      Assets/Scripts/GameUI/UI/DaoYouPanel/DaoYouInfoPanel.cs

+ 10 - 8
Assets/Scripts/GameUI/UI/DaoYouPanel/DaoYouInfoPanel.cs

@@ -139,18 +139,16 @@ namespace Fort23.Mono
                 {
                     return;
                 }
-                if (!PlayerManager.Instance.BagController.DeductItem(daoyouGiftConfig.ItemID, count))
-                {
-                    TipMessagePanel.OpenTipMessagePanel(10324);
-                    return;
-                }
                 
-
                 //加好感
                 if (widgetItem1 != null && daoyouGiftConfig.ID != 0)
                 {
                     //TODO 消耗:送礼给道友
-                    // bool isok =PlayerManager.Instance.BagController.DeductItem(daoyouGiftConfig.ItemID, count);
+                   if (PlayerManager.Instance.BagController.DeductItem(daoyouGiftConfig.ItemID, count))
+                   {
+                       TipMessagePanel.OpenTipMessagePanel(10324);
+                       return;
+                   }
 
 
                     emotionConfig emotionConfig = ConfigComponent.Instance.Get<emotionConfig>(daoYouData.emotion);
@@ -207,7 +205,11 @@ namespace Fort23.Mono
                     }
 
                     //TODO 消耗:送礼给道友
-                    // PlayerManager.Instance.BagController.DeductItem(widgetItem1.itemInfo.itemID, count);
+                    if (PlayerManager.Instance.BagController.DeductItem(widgetItem1.itemInfo.itemID, count))
+                    {
+                        TipMessagePanel.OpenTipMessagePanel(10324);
+                        return;
+                    }
                     daoYouData.emotionValue += widgetItem1.itemInfo.config.associateVlaue[0];
 
                     int emotionId = 4 - (int)(daoYouData.emotionValue / (100 / (float)3));