Skip to content

Commit

Permalink
fix: Fixes region duplicates (#1684)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamronbatman committed Feb 18, 2024
1 parent d0d7be8 commit 0d5aa1d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
5 changes: 5 additions & 0 deletions Projects/Server/Maps/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,11 @@ public void OnLeave(Mobile mob)

public void OnEnter(Region region, Rectangle3D rect)
{
if (_regions?.Contains(region) == true)
{
return;
}

Utility.Add(ref _regions, region);

_regions.Sort();
Expand Down
5 changes: 3 additions & 2 deletions Projects/Server/Regions/Region.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,11 @@ public void Register()
{
var sector = Map.GetRealSector(x, y);

sector.OnEnter(this, rect);

// Region Areas are approximate and will overlap
// Don't add them multiple times!
if (!sectors.Contains(sector))
{
sector.OnEnter(this, rect);
sectors.Add(sector);
}
}
Expand Down
23 changes: 9 additions & 14 deletions Projects/UOContent/Gumps/HouseDemolishGump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,22 @@ public override void OnResponse(NetState state, RelayInfo info)
}*/
if (m_House.HasRentedVendors && m_House.VendorInventories.Count > 0)
{
m_Mobile.SendLocalizedMessage(
1062679
); // You cannot do that that while you still have contract vendors or unclaimed contract vendor inventory in your house.
// You cannot do that that while you still have contract vendors or unclaimed contract vendor inventory in your house.
m_Mobile.SendLocalizedMessage(1062679);
return;
}

if (m_House.HasRentedVendors)
{
m_Mobile.SendLocalizedMessage(
1062680
); // You cannot do that that while you still have contract vendors in your house.
// You cannot do that that while you still have contract vendors in your house.
m_Mobile.SendLocalizedMessage(1062680);
return;
}

if (m_House.VendorInventories.Count > 0)
{
m_Mobile.SendLocalizedMessage(
1062681
); // You cannot do that that while you still have unclaimed contract vendor inventory in your house.
// You cannot do that that while you still have unclaimed contract vendor inventory in your house.
m_Mobile.SendLocalizedMessage(1062681);
return;
}

Expand All @@ -105,7 +102,7 @@ public override void OnResponse(NetState state, RelayInfo info)
}
else
{
Item toGive = null;
Item toGive;

if (m_House.IsAosRules)
{
Expand Down Expand Up @@ -155,10 +152,8 @@ public override void OnResponse(NetState state, RelayInfo info)
{
if (check != null)
{
m_Mobile.SendLocalizedMessage(
1060397,
check.Worth.ToString()
); // ~1_AMOUNT~ gold has been deposited into your bank box.
// ~1_AMOUNT~ gold has been deposited into your bank box.
m_Mobile.SendLocalizedMessage(1060397, check.Worth.ToString());
}

m_House.RemoveKeys(m_Mobile);
Expand Down
2 changes: 1 addition & 1 deletion Projects/UOContent/Multis/Houses/BaseHouse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public BaseHouse(int multiID, Mobile owner, int maxLockDown, int maxSecure) : ba

m_RelativeBanLocation = BaseBanLocation;

UpdateRegion();
// UpdateRegion();

if (owner != null)
{
Expand Down

0 comments on commit 0d5aa1d

Please sign in to comment.