From 62c8f44508d013ca4da0dcc12e3d92c4984ec585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Thu, 28 Aug 2025 14:05:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=BA=94=E7=94=A8=E5=87=BD=E6=95=B0=E6=9C=AA?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E9=BB=98=E8=AE=A4=E5=80=BC=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改FieldStore.gd中entityApplier的函数,确保所有函数都返回true 修复Feed.gd中get方法调用缺少默认参数的问题 --- scripts/Structs/Feed.gd | 2 +- scripts/Tools/FieldStore.gd | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/Structs/Feed.gd b/scripts/Structs/Feed.gd index ad75e2c..aa9e097 100644 --- a/scripts/Structs/Feed.gd +++ b/scripts/Structs/Feed.gd @@ -68,7 +68,7 @@ func apply(entity: EntityBase): for i in range(min(fields.size(), fieldValues.size())): var field = fields[i] var value = fieldValues[i] - var applier = FieldStore.entityApplier.get(field, null) + var applier = FieldStore.entityApplier.get(field) if !applier or applier.call(entity, value): entity.fields[field] += value entity.fields[field] = clamp(entity.fields[field], 0, FieldStore.entityMaxValueMap.get(field, INF)) diff --git a/scripts/Tools/FieldStore.gd b/scripts/Tools/FieldStore.gd index b4f658c..195af25 100644 --- a/scripts/Tools/FieldStore.gd +++ b/scripts/Tools/FieldStore.gd @@ -80,12 +80,15 @@ static var entityMaxValueMap = { static var entityApplier = { Entity.MAX_HEALTH: func(entity, value): entity.health += value + return true , Entity.EXTRA_APPLE_MAX: func(entity, value): entity.inventoryMax[ItemStore.ItemType.APPLE] += value + return true , Entity.EXTRA_BULLET_COUNT: func(entity, value): entity.fields[Entity.OFFSET_SHOOT] += value * 5 + return true , }