fix: Fixes axes not working when equipped or in backpack (#2112)

This commit is contained in:
Kamron Batman 2025-02-04 22:11:29 -08:00 • committed by GitHub
parent b83c52a7b1
commit d407847fc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 224 additions and 227 deletions

View file

@ -17,16 +17,18 @@ public partial class FishingPole : Item
public override void OnDoubleClick(Mobile from)
{
var loc = GetWorldLocation();
if (!IsChildOf(from))
{
var loc = GetWorldLocation();
if (!from.InLOS(loc) || !from.InRange(loc, 2))
{
from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1019045); // I can't reach that
}
else
{
Fishing.System.BeginHarvesting(from, this);
if (!from.InLOS(loc) || !from.InRange(loc, 2))
{
from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1019045); // I can't reach that
return;
}
}
Fishing.System.BeginHarvesting(from, this);
}
public override void GetContextMenuEntries(Mobile from, ref PooledRefList<ContextMenuEntry> list)

View file

@ -59,28 +59,29 @@ public partial class RecipeScroll : Item
var r = Recipe;
if (r != null && from is PlayerMobile pm)
if (r == null || from is not PlayerMobile pm)
{
if (!pm.HasRecipe(r))
{
var chance = r.CraftItem.GetSuccessChance(pm, null, r.CraftSystem, false, out var allRequiredSkills);
return;
}
if (allRequiredSkills && chance >= 0.0)
{
// You have learned a new recipe: ~1_RECIPE~
pm.SendLocalizedMessage(1073451, r.TextDefinition.ToString());
pm.AcquireRecipe(r);
Delete();
}
else
{
pm.SendLocalizedMessage(1044153); // You don't have the required skills to attempt this item.
}
}
else
{
pm.SendLocalizedMessage(1073427); // You already know this recipe.
}
if (pm.HasRecipe(r))
{
pm.SendLocalizedMessage(1073427); // You already know this recipe.
return;
}
var chance = r.CraftItem.GetSuccessChance(pm, null, r.CraftSystem, false, out var allRequiredSkills);
if (allRequiredSkills && chance >= 0.0)
{
// You have learned a new recipe: ~1_RECIPE~
pm.SendLocalizedMessage(1073451, r.TextDefinition.ToString());
pm.AcquireRecipe(r);
Delete();
}
else
{
pm.SendLocalizedMessage(1044153); // You don't have the required skills to attempt this item.
}
}
}