From a608566d51391f045aa3ea595fc7bea6c72c75f2 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 23 十月 2018 21:09:35 +0800
Subject: [PATCH] 2197 【1.2】【1.1】封魔坛报错修复

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py
index c2a74b8..8cb7cbb 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py
@@ -185,6 +185,8 @@
 def DoExitFB(curPlayer, tick):
     global g_npcHurtDict
     gameWorld = GameWorld.GetGameWorld()
+    # 清除鼓舞buff
+    FBCommon.ClearEncourageBuff(curPlayer, tick)
     #最后一人
     if gameWorld.GetMapCopyPlayerManager().GetPlayerCount() == 1:
         mapID = GameWorld.GetMap().GetMapID()
@@ -195,11 +197,10 @@
             gameWorld.SetGameWorldDict(FBDict_StartTick % lineID, 0)
             GameWorld.GetGameFB().ClearGameFBDict()
             GameWorldProcess.CloseFB(tick)
-            
+            return
         
     UpdateHPReduceSpeed(tick, True)
-    # 清除鼓舞buff
-    FBCommon.ClearEncourageBuff(curPlayer, tick)
+    
     return
 
 ##玩家主动离开副本.
@@ -263,8 +264,9 @@
     curSpeed = GameWorld.GetGameWorld().GetGameWorldDictByKey(FBDict_Speed % lineID) 
     remainHP = GetBossRemainHP(lineID, tick)
     totalHP = __GetBossTotalHP()
-    
-    fbHelpDict = {FBCommon.Help_lineID:lineID, "hurtInfo":hurtInfo, 'hpReduceSpeed':curSpeed * 10000 / totalHP, 'remainHPPer':min(100, remainHP * 100 / totalHP)}
+    hpReduceSpeed = curSpeed * 10000 / totalHP if totalHP else 0
+    remainHPPer = min(100, remainHP * 100 / totalHP) if totalHP else 0
+    fbHelpDict = {FBCommon.Help_lineID:lineID, "hurtInfo":hurtInfo, 'hpReduceSpeed':hpReduceSpeed, 'remainHPPer':remainHPPer}
     GameWorld.DebugLog("DoFBHelp: %s" % fbHelpDict, curPlayer.GetPlayerID())
     FBCommon.Notify_FBHelp(curPlayer, fbHelpDict)
     return
@@ -616,9 +618,11 @@
         return
     playerCnt = GameWorld.GetGameWorld().GetMapCopyPlayerManager().GetPlayerCount()
     playerCnt = playerCnt - 1 if isExit else playerCnt
-    if not playerCnt:
+    if playerCnt <=0:
         return
     lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+    if lineID < 0:
+        return
     gameWorld = GameWorld.GetGameWorld()
     startTick = gameWorld.GetGameWorldDictByKey(FBDict_StartTick % lineID)
     lastSpeed = gameWorld.GetGameWorldDictByKey(FBDict_Speed % lineID)

--
Gitblit v1.8.0