diff options
Diffstat (limited to 'OpenSim/Services/GridService/GridService.cs')
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index af7a511..8807397 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -539,13 +539,24 @@ namespace OpenSim.Services.GridService | |||
539 | // multiples of the legacy region size (256). | 539 | // multiples of the legacy region size (256). |
540 | public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) | 540 | public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) |
541 | { | 541 | { |
542 | int snapX = (int)(x / Constants.RegionSize) * (int)Constants.RegionSize; | 542 | uint regionX = Util.WorldToRegionLoc((uint)x); |
543 | int snapY = (int)(y / Constants.RegionSize) * (int)Constants.RegionSize; | 543 | uint regionY = Util.WorldToRegionLoc((uint)y); |
544 | int snapX = (int)Util.RegionToWorldLoc(regionX); | ||
545 | int snapY = (int)Util.RegionToWorldLoc(regionY); | ||
546 | |||
544 | RegionData rdata = m_Database.Get(snapX, snapY, scopeID); | 547 | RegionData rdata = m_Database.Get(snapX, snapY, scopeID); |
545 | if (rdata != null) | 548 | if (rdata != null) |
549 | { | ||
550 | m_log.DebugFormat("{0} GetRegionByPosition. Found region {1} in database. Pos=<{2},{3}>", | ||
551 | LogHeader, rdata.RegionName, regionX, regionY); | ||
546 | return RegionData2RegionInfo(rdata); | 552 | return RegionData2RegionInfo(rdata); |
547 | 553 | } | |
548 | return null; | 554 | else |
555 | { | ||
556 | m_log.DebugFormat("{0} GetRegionByPosition. Did not find region in database. Pos=<{1},{2}>", | ||
557 | LogHeader, regionX, regionY); | ||
558 | return null; | ||
559 | } | ||
549 | } | 560 | } |
550 | 561 | ||
551 | public GridRegion GetRegionByName(UUID scopeID, string name) | 562 | public GridRegion GetRegionByName(UUID scopeID, string name) |