🐛 修复高星作物的收获次数不在原作物统计

This commit is contained in:
Mualamx
2025-10-27 11:41:23 +08:00
parent a59ac4ded6
commit 36e7c8d580
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ class CUserSoilDB(CSqlManager):
Args: Args:
soilIndex (int): 地块索引 从1开始 soilIndex (int): 地块索引 从1开始
""" """
if not g_bIsDebug: if g_bIsDebug:
return return
soilInfo = await cls.getUserSoil(uid, soilIndex) soilInfo = await cls.getUserSoil(uid, soilIndex)
+8 -1
View File
@@ -631,8 +631,15 @@ class CFarmManager:
# 统计收获次数 # 统计收获次数
try: try:
# 统一处理星级植物名称
plant_name = soilInfo["plantName"]
# 简单判断是否包含"星",如果包含则分割取后半部分
if "星" in plant_name:
plant_name = plant_name.split("星", 1)[-1]
await g_pDBService.userPlantCount.addUserPlantCountByUid( await g_pDBService.userPlantCount.addUserPlantCountByUid(
uid, soilInfo["plantName"] uid, plant_name
) )
except Exception: except Exception:
# 忽略统计异常,避免影响主流程 # 忽略统计异常,避免影响主流程