From 597bd7b9d56cde344ec25ec7a35b59fd6f3cf46a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <1@72wo.cn> Date: Mon, 15 Dec 2025 15:09:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(logic/service/fight):=20=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E7=8E=A9=E5=AE=B6=E6=97=B6=E6=AD=A3=E7=A1=AE=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=AE=A0=E7=89=A9=E6=9C=80=E5=A4=A7=E7=94=9F=E5=91=BD?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当宠物的 Hp 字段不为零时,现在会正确地将该值赋给宠物的 MaxHp 属性。这确保了 宠物的最大生命值得到正确初始化,避免了可能的游戏逻辑错误。 --- logic/service/fight/input.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/logic/service/fight/input.go b/logic/service/fight/input.go index bb07a14f..ca047e1f 100644 --- a/logic/service/fight/input.go +++ b/logic/service/fight/input.go @@ -194,6 +194,11 @@ func (f *FightC) initplayer(c common.PlayerI) (*input.Input, errorcode.ErrorCode pet.Prop = [5]uint32(v.Prop) + } + + if v.Hp != 0 { + pet.MaxHp = uint32(v.Hp) + } if len(v.SKill) != 0 {