From 350137e48a88e5a19588434edd8e78860d90647f Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 02 九月 2024 10:36:38 +0800
Subject: [PATCH] 10130 【后端】福地争夺资源功能(剩余时间为0报错防范;)

---
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldMineArea.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldMineArea.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldMineArea.py
index 4ec606f..e03977e 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldMineArea.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldMineArea.py
@@ -530,6 +530,9 @@
         battleRatio = workerBattleRatioList[len(workerBattleRatioList) - 1] if batWorkerCount > len(workerBattleRatioList) else workerBattleRatioList[batWorkerCount - 1]
         
     needSeconds = int(dist * itemWeight * baseTime * workRatio * battleRatio) # 还需工作时长,秒
+    if needSeconds <= 0:
+        return 0, 0
+    
     moveSpeed = dist / float(needSeconds) # 移动速度  x格/秒
     needHms = "%02d:%02d:%02d" % (needSeconds / 3600, needSeconds % 3600 / 60, needSeconds % 60)
     

--
Gitblit v1.8.0