fix(logic/service/fight): 初始化玩家时正确设置宠物最大生命值
当宠物的 Hp 字段不为零时,现在会正确地将该值赋给宠物的 MaxHp 属性。这确保了 宠物的最大生命值得到正确初始化,避免了可能的游戏逻辑错误。
This commit is contained in:
@@ -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 {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user