refactor: 优化宠物类型变量使用并简化条件判断

This commit is contained in:
xinian
2026-03-01 08:59:39 +08:00
committed by cnb
parent 49f8de8661
commit f1a5b90ca5

View File

@@ -174,9 +174,9 @@ func (Controller) OnPlayerFightNpcMonster(data1 *fight.FightNpcMonsterInboundInf
items.ADDitem(3, uint32(poolexp))
p.AddPetExp(foi.Winpet, int64(addexp))
if monster.IsShiny() && p.CanGetXUAN() &&xmlres.PetMAP[int(refPet.GetID())].Type<16{
xuan := 400686 + int64(xmlres.PetMAP[int(refPet.GetID())].Type)
pettype := int64(xmlres.PetMAP[int(refPet.GetID())].Type)
if monster.IsShiny() && p.CanGetXUAN() && pettype < 16 {
xuan := 400686 + pettype
ok := p.ItemAdd(xuan, 1)
if ok {
items.ADDitem(uint32(xuan), 1)