fix: Fixes drag drop bounce issue (#1040)
This commit is contained in:
parent
aeec7f78fd
commit
98a74a89c7
2 changed files with 28 additions and 23 deletions
|
|
@ -2074,10 +2074,13 @@ namespace Server
|
||||||
MoveToWorld(from.Location, from.Map);
|
MoveToWorld(from.Location, from.Map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((parent as Mobile)?.EquipItem(this) == false)
|
else if (parent is Mobile mobile)
|
||||||
|
{
|
||||||
|
if (!mobile.EquipItem(this))
|
||||||
{
|
{
|
||||||
MoveToWorld(bounce.WorldLoc, bounce.Map);
|
MoveToWorld(bounce.WorldLoc, bounce.Map);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MoveToWorld(from.Location, from.Map);
|
MoveToWorld(from.Location, from.Map);
|
||||||
|
|
|
||||||
|
|
@ -564,8 +564,11 @@ namespace Server.Items
|
||||||
|
|
||||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||||
{
|
{
|
||||||
if (dropped is SpellScroll scroll && scroll.Amount == 1)
|
if (dropped is not SpellScroll { Amount: 1 } scroll)
|
||||||
{
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
var type = GetTypeForSpell(scroll.SpellID);
|
var type = GetTypeForSpell(scroll.SpellID);
|
||||||
|
|
||||||
if (type != SpellbookType)
|
if (type != SpellbookType)
|
||||||
|
|
@ -593,7 +596,6 @@ namespace Server.Items
|
||||||
from.SendSound(0x249, GetWorldLocation());
|
from.SendSound(0x249, GetWorldLocation());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue