flowerpig před 5 měsíci
rodič
revize
0c1c4ec3b6

+ 7 - 3
script/module/absAct/DrumBlastingLogic.lua

@@ -162,7 +162,9 @@ function get(human,index,type,id)
             for i = 1, #taskConfig do
                 local v = taskConfig[i]
                 if v.day == nowDay then
-                    local taskState = absAct.drum[i] and absAct.drum[i].state or 0
+                    -- 确保数据结构存在
+                    absAct.drum[i] = absAct.drum[i] or {}
+                    local taskState = absAct.drum[i].state or 0
                     if taskState == 1 then
                         hasReward = true
                         -- 收集奖励
@@ -179,7 +181,9 @@ function get(human,index,type,id)
             local taskConfig = AbsActExcel.blasting
             for i = 1, #taskConfig do
                 local v = taskConfig[i]
-                local blastingState = absAct.blasting[i] and absAct.blasting[i].state or 0
+                -- 确保数据结构存在
+                absAct.blasting[i] = absAct.blasting[i] or {}
+                local blastingState = absAct.blasting[i].state or 0
                 if blastingState == 1 then
                     hasReward = true
                     -- 收集奖励
@@ -190,7 +194,7 @@ function get(human,index,type,id)
                     -- 更新状态
                     absAct.blasting[i].state = 2
                     -- 增加一次,累计放炮次数,判断是否达到进度奖励领取值
-                    absAct.blastingCnt = absAct.blastingCnt + 1
+                    absAct.blastingCnt = (absAct.blastingCnt or 0) + 1
                     for j = 1, #AbsActExcel.blastingBox do
                         if absAct.blastingCnt - 1 < AbsActExcel.blastingBox[j].needCnt and absAct.blastingCnt == AbsActExcel.blastingBox[j].needCnt then
                             absAct.box[j] = 1

+ 12 - 1
script/module/bag/BagLogic.lua

@@ -178,6 +178,11 @@ function addItem(human, id, cnt, logType, noSend, otherData)
         
     -- 根据道具触发红点
 	checkDotByID(human,id)
+	
+	-- 幽暗禁地红点:当道具1034、1035、1036数量变化时,更新红点
+	if id == 1034 or id == 1035 or id == 1036 then
+		RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1215)
+	end
 
 	if itemConfig.subType == ItemDefine.ITEM_SUBTYPE_ELF then
 		--print("[addItem] 触发获得精灵")
@@ -234,7 +239,13 @@ function delItem(human, id, cnt, logType, noSend, byId, byCnt)
     if id == ItemDefine.ITEM_GREEN_EXP_ID then
 		HeroGrowUp.onCallback(human, HeroGrowUp.TASKTYPE18, cnt)
 		TriggerLogic.PublishEvent(TriggerDefine.JINGYAN_DEL, human.db._id, cnt)
-	end	
+	end
+	
+	-- 幽暗禁地红点:当道具1034、1035、1036数量变化时,更新红点
+	if id == 1034 or id == 1035 or id == 1036 then
+		RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1215)
+	end
+	
 	return true
 end
 

+ 0 - 1
webServer/src/router/index.ts

@@ -92,5 +92,4 @@ router.post("/qqReport", TencentController.qqReport);
 // mianyou开服同步
 router.post("/mianyou/syncServer", ApiController.mianyouSyncServer);
 
-
 module.exports = router;