From 04a2cc7b4d78f54c461837fb1f271c5dc81757fd Mon Sep 17 00:00:00 2001 From: Art_Sakura <1754798088@qq.com> Date: Fri, 30 May 2025 16:07:34 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E4=BA=86?= =?UTF-8?q?=E4=BD=9C=E7=89=A9=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E7=BB=98?= =?UTF-8?q?=E5=88=B6=E7=A7=8D=E5=AD=90=E7=8A=B6=E6=80=81=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __init__.py | 2 +- database/userSoil.py | 7 +------ farm/farm.py | 8 ++------ 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/__init__.py b/__init__.py index 1c40f66..4909206 100644 --- a/__init__.py +++ b/__init__.py @@ -39,7 +39,7 @@ __plugin_meta__ = PluginMetadata( """.strip(), extra=PluginExtraData( author="Art_Sakura", - version="1.4", + version="1.4.1", commands=[Command(command="我的农场")], menu_type="群内小游戏", configs=[ diff --git a/database/userSoil.py b/database/userSoil.py index 291d4d1..6bec465 100644 --- a/database/userSoil.py +++ b/database/userSoil.py @@ -56,13 +56,8 @@ class CUserSoilDB(CSqlManager): if currentTime >= soilInfo['matureTime']: return - currentStage = 0 elapsedTime = currentTime - soilInfo['plantTime'] - - for idx, thr in enumerate(phaseList, start=1): - if elapsedTime < thr: - currentStage = idx - break + currentStage = currentStage = sum(1 for thr in phaseList if elapsedTime >= thr) t = int(soilInfo['plantTime']) - phaseList[currentStage] s = int(soilInfo['matureTime']) - phaseList[currentStage] diff --git a/farm/farm.py b/farm/farm.py index 5d6978d..a1bf1dd 100644 --- a/farm/farm.py +++ b/farm/farm.py @@ -308,13 +308,9 @@ class CFarmManager: # return True, plant, False, offsetX, offsetY #如果没有成熟 则根据当前阶段进行绘制 - currentStage = 0 - elapsedTime = currentTime - soilInfo['plantTime'] - for idx, thr in enumerate(phaseList, start=1): - if elapsedTime < thr: - currentStage = idx - break + elapsedTime = currentTime - soilInfo['plantTime'] + currentStage = sum(1 for thr in phaseList if elapsedTime >= thr) if currentStage <= 0: if plantInfo['general'] == False: