From 1353fa6afbfbf1f01a745253fa380ffbdb05df3b Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期三, 07 十一月 2018 09:52:13 +0800
Subject: [PATCH] 4398 【1.2】聊天气泡框前端去掉Vip礼包的支持

---
 System/Chat/ChatBubbleModel.cs |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/System/Chat/ChatBubbleModel.cs b/System/Chat/ChatBubbleModel.cs
index c2ba3d0..53d4cd9 100644
--- a/System/Chat/ChatBubbleModel.cs
+++ b/System/Chat/ChatBubbleModel.cs
@@ -68,33 +68,26 @@
             return chatBubbles.TryGetValue(id, out bubble);
         }
 
-        public bool IsBubbleGot(int id, out int reason)
+        public bool IsBubbleGot(int id)
         {
             ChatBubble bubble;
-            reason = 0;
             if (TryGetBubble(id, out bubble))
             {
                 var config = Config.Instance.Get<ChatBubbleBoxConfig>(id);
-                if (config.NeedLV != 0)
-                {
-                    reason = 1;
-                    return PlayerDatas.Instance.baseData.LV >= config.NeedLV;
-                }
-                if (config.NeedVIPLVGift != 0)
-                {
-                    reason = 2;
-                    var gift = vipModel.GetVipGift(config.NeedVIPLVGift);
-                    return gift != null && gift.hasBuy;
-                }
+                bool got = false;
                 try
                 {
-                    reason = 3;
-                    return MathUtility.GetBitValue(bubbleState, (ushort)id);
+                    got = MathUtility.GetBitValue(bubbleState, (ushort)id);
                 }
                 catch (ArgumentOutOfRangeException)
                 {
                     DebugEx.LogError("鐩墠涓嶆敮鎸乮d瓒呰繃31鐨勮亰澶╂锛�" + id);
                 }
+                if (!got && config.NeedLV != 0)
+                {
+                    return PlayerDatas.Instance.baseData.LV >= config.NeedLV;
+                }
+                return got;
             }
             return false;
         }
@@ -112,8 +105,7 @@
 
         public void SendUseBubble(int id)
         {
-            var reason = 0;
-            if (!IsBubbleGot(id, out reason))
+            if (!IsBubbleGot(id))
             {
                 return;
             }

--
Gitblit v1.8.0