fix: Fixes possibel NPE with misbehaving Weapon property (#1083)

This commit is contained in:
Kamron Batman 2022-06-20 16:31:39 -07:00 committed by GitHub
parent 8509b1f8a0
commit da877f59a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -738,7 +738,7 @@ namespace Server
var weapon = Weapon; var weapon = Weapon;
if (!InRange(combatant, weapon.MaxRange)) if (weapon == null || !InRange(combatant, weapon.MaxRange))
{ {
return; return;
} }

View file

@ -35,7 +35,7 @@ namespace Server.Items
public override WeaponType DefType => WeaponType.Fists; public override WeaponType DefType => WeaponType.Fists;
public override WeaponAnimation DefAnimation => WeaponAnimation.Wrestle; public override WeaponAnimation DefAnimation => WeaponAnimation.Wrestle;
public static void Initialize() public static void Configure()
{ {
Mobile.DefaultWeapon = new Fists(); Mobile.DefaultWeapon = new Fists();