mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
修复圣遗物替换的小问题并优化
This commit is contained in:
@@ -44,15 +44,6 @@ func (p *Player) GetWeaponGuid(weaponId uint64) uint64 {
|
||||
return weaponInfo.Guid
|
||||
}
|
||||
|
||||
func (p *Player) GetWeaponIdByGuid(guid uint64) uint64 {
|
||||
for weaponId, weapon := range p.WeaponMap {
|
||||
if guid == weapon.Guid {
|
||||
return weaponId
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (p *Player) GetWeapon(weaponId uint64) *Weapon {
|
||||
return p.WeaponMap[weaponId]
|
||||
}
|
||||
@@ -91,5 +82,6 @@ func (p *Player) CostWeapon(weaponId uint64) uint64 {
|
||||
return 0
|
||||
}
|
||||
delete(p.WeaponMap, weaponId)
|
||||
delete(p.GameObjectGuidMap, weapon.Guid)
|
||||
return weapon.Guid
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user