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

@ -24,32 +24,30 @@ public partial class PrismaticCrystal : Item
return;
}
if (pm.InRange(GetWorldLocation(), 2))
if (!pm.InRange(GetWorldLocation(), 2))
{
if (MLQuestSystem.GetContext(pm)?.IsDoingQuest(typeof(UnfadingMemoriesPartOne)) == true &&
pm.Backpack.FindItemByType<PrismaticAmber>(false) == null)
{
Item amber = new PrismaticAmber();
pm.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
return;
}
if (pm.PlaceInBackpack(amber))
{
MLQuestSystem.MarkQuestItem(pm, amber);
Delete();
}
else
{
pm.SendLocalizedMessage(502385); // Your pack cannot hold this item.
amber.Delete();
}
}
else
{
pm.SendLocalizedMessage(1075464); // You already have as many of those as you need.
}
if (MLQuestSystem.GetContext(pm)?.IsDoingQuest(typeof(UnfadingMemoriesPartOne)) != true ||
pm.Backpack.FindItemByType<PrismaticAmber>(false) != null)
{
pm.SendLocalizedMessage(1075464); // You already have as many of those as you need.
return;
}
var amber = new PrismaticAmber();
if (pm.PlaceInBackpack(amber))
{
MLQuestSystem.MarkQuestItem(pm, amber);
Delete();
}
else
{
pm.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
pm.SendLocalizedMessage(502385); // Your pack cannot hold this item.
amber.Delete();
}
}
}

View file

@ -467,12 +467,15 @@ public partial class PlantItem : Item, ISecurable
return;
}
var loc = GetWorldLocation();
if (!from.InLOS(loc) || !from.InRange(loc, 2))
if (!IsChildOf(from))
{
from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1019045); // I can't reach that.
return;
var loc = GetWorldLocation();
if (!from.InLOS(loc) || !from.InRange(loc, 2))
{
from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1019045); // I can't reach that
return;
}
}
if (!IsUsableBy(from))