change bitmasks work

0.9.1.0-post-fixes
UbitUmarov 2018-07-14 15:21:59 +01:00
parent 8ab5a87520
commit 0731220a9d
2 changed files with 4 additions and 11 deletions

View File

@ -2033,25 +2033,18 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
UUID parcel = UUID.Zero; UUID parcel = UUID.Zero;
UUID.TryParse(id, out parcel); UUID.TryParse(id, out parcel);
// assume we've got the parcelID we just computed in RemoteParcelRequest // assume we've got the parcelID we just computed in RemoteParcelRequest
ExtendedLandData extLandData = new ExtendedLandData(); ExtendedLandData extLandData = new ExtendedLandData();
if(!Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle, if(!Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle,
out extLandData.X, out extLandData.Y)) out extLandData.X, out extLandData.Y))
return null; return null;
m_log.DebugFormat("[LAND MANAGEMENT MODULE] : Got parcelinfo request for regionHandle {0}, x/y {1}/{2}", m_log.DebugFormat("[LAND MANAGEMENT MODULE]: Got parcelinfo request for regionHandle {0}, x/y {1}/{2}",
extLandData.RegionHandle, extLandData.X, extLandData.Y); extLandData.RegionHandle, extLandData.X, extLandData.Y);
// for this region or for somewhere else? // for this region or for somewhere else?
if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle) if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle)
{ {
ILandObject extLandObject = this.GetLandObject(extLandData.X, extLandData.Y); extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData;
if(extLandObject == null)
{
m_log.DebugFormat("[LAND MANAGEMENT MODULE]: ParcelInfoRequest: a FakeParcelID points to outside the region");
return null;
}
extLandData.LandData = extLandObject.LandData;
extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel; extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel;
} }
else else

View File

@ -1460,9 +1460,9 @@ namespace OpenSim.Region.CoreModules.World.Land
for (int i = 0; i < bitmapLen; i++) for (int i = 0; i < bitmapLen; i++)
{ {
tempByte = LandData.Bitmap[i]; tempByte = LandData.Bitmap[i];
for (int bitNum = 0; bitNum < 8; bitNum++) for (int bitmask = 0x80; bitmask > 0; bitmask = bitmask >> 1)
{ {
bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte) 1); bool bit = (tempByte & bitmask) == bitmask;
try try
{ {
tempConvertMap[x, y] = bit; tempConvertMap[x, y] = bit;