Files
NewWPSBot/.tasks/2025-11-13_1_garden-steal-bug.md

30 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 背景
文件名: 2025-11-13_1_garden-steal-bug.md
创建于: 2025-11-13_22:02:46
创建者: ASUS
主分支: main
任务分支: (未创建)
Yolo模式: Off
# 任务描述
当前菜园系统偷取后完全不会减少收获时的果实数量, 找到这个bug的解决方案
# 项目概览
WPSBot 项目的菜园系统及相关偷取逻辑。
# 分析
`garden_service.py` 中,`steal` 会把 `remaining_fruit` 减 1 并更新数据库。
`harvest` 在结算时仍直接使用 `plot["base_yield"]` 作为产量,并在结算后删除地块记录,完全忽略了被偷后更新过的 `remaining_fruit`
因此,偷取行为不会影响最终收获数量,符合报告的问题表现。
# 提议的解决方案
-`GardenService.harvest` 中使用 `remaining_fruit` 作为实际收获量,确保偷取后的剩余数量被正确结算。
- 保留 `base_yield` 仅用于偷取阈值等初始参数,避免改动其它逻辑。
# 当前执行步骤:"5. 待用户验证"
# 任务进度
- 2025-11-13_23:05:44已修改Plugins/WPSGardenSystem/garden_service.py将收获逻辑切换为使用 `remaining_fruit` 作为产量,并保留初始产量信息|原因:确保偷取后剩余数在收获时生效|阻碍因素:无|状态:未确认
# 最终审查