fix: Fixes arrows in the internal map (#2336)

This commit is contained in:
Kamron Batman 2026-02-12 21:31:42 -08:00 • committed by GitHub
parent 7fe9712593
commit f7eab79adb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -107,11 +107,10 @@ namespace Server.Items
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus = 1) public override void OnHit(Mobile attacker, Mobile defender, double damageBonus = 1)
{ {
var ammo = Ammo; if (attacker.Player && !defender.Player && (defender.Body.IsAnimal || defender.Body.IsMonster) &&
if (ammo != null && attacker.Player && !defender.Player && (defender.Body.IsAnimal || defender.Body.IsMonster) && Utility.RandomDouble() < 0.4 && Ammo is { } ammo && !defender.AddToBackpack(ammo))
Utility.RandomDouble() < 0.4)
{ {
defender.AddToBackpack(ammo); ammo.Delete();
} }
if (Core.ML && _velocity > 0) if (Core.ML && _velocity > 0)