fix: Fixes region duplicates (#1684)
This commit is contained in:
parent
d0d7be8de0
commit
0d5aa1d022
4 changed files with 18 additions and 17 deletions
|
|
@ -1450,6 +1450,11 @@ public sealed partial class Map : IComparable<Map>, ISpanFormattable, ISpanParsa
|
|||
|
||||
public void OnEnter(Region region, Rectangle3D rect)
|
||||
{
|
||||
if (_regions?.Contains(region) == true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Utility.Add(ref _regions, region);
|
||||
|
||||
_regions.Sort();
|
||||
|
|
|
|||
|
|
@ -365,10 +365,11 @@ public class Region : IComparable<Region>, IValueLinkListNode<Region>
|
|||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,25 +75,22 @@ namespace Server.Gumps
|
|||
}*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
@ -105,7 +102,7 @@ namespace Server.Gumps
|
|||
}
|
||||
else
|
||||
{
|
||||
Item toGive = null;
|
||||
Item toGive;
|
||||
|
||||
if (m_House.IsAosRules)
|
||||
{
|
||||
|
|
@ -155,10 +152,8 @@ namespace Server.Gumps
|
|||
{
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ namespace Server.Multis
|
|||
|
||||
m_RelativeBanLocation = BaseBanLocation;
|
||||
|
||||
UpdateRegion();
|
||||
// UpdateRegion();
|
||||
|
||||
if (owner != null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue