fix: Eliminates double lookup with Contains->Remove (#2539)
This commit is contained in:
parent
e12cc5dd83
commit
8d88ef70fd
12 changed files with 25 additions and 80 deletions
|
|
@ -54,15 +54,13 @@ public partial class Guildstone : Item, IAddon, IChoppable
|
|||
|
||||
var house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house?.IsOwner(from) == true && house.Addons.Contains(this))
|
||||
if (house?.IsOwner(from) == true && house.Addons.Remove(this))
|
||||
{
|
||||
Effects.PlaySound(GetWorldLocation(), Map, 0x3B3);
|
||||
from.SendLocalizedMessage(500461); // You destroy the item.
|
||||
|
||||
Delete();
|
||||
|
||||
house.Addons.Remove(this);
|
||||
|
||||
var deed = Deed;
|
||||
|
||||
if (deed != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue