mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
check land permitions on sit target for unscripted sits
This commit is contained in:
@@ -442,6 +442,19 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CanBeOnThisLand(UUID avatar, float posHeight)
|
||||
{
|
||||
if (posHeight < LandChannel.BAN_LINE_SAFETY_HIEGHT && IsBannedFromLand(avatar))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (IsRestrictedFromLand(avatar))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool HasGroupAccess(UUID avatar)
|
||||
{
|
||||
if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup)
|
||||
|
||||
@@ -2247,6 +2247,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private bool CanEnterLandPosition(Vector3 testPos)
|
||||
{
|
||||
ILandObject land = m_scene.LandChannel.GetLandObject(testPos.X, testPos.Y);
|
||||
|
||||
if (land == null || land.LandData.Name == "NO_LAND")
|
||||
return true;
|
||||
|
||||
return land.CanBeOnThisLand(UUID,testPos.Z);
|
||||
}
|
||||
|
||||
// status
|
||||
// < 0 ignore
|
||||
// 0 bad sit spot
|
||||
@@ -2265,6 +2276,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (part == null)
|
||||
return;
|
||||
|
||||
Vector3 targetPos = part.GetWorldPosition() + offset * part.GetWorldRotation();
|
||||
if(!CanEnterLandPosition(targetPos))
|
||||
{
|
||||
ControllingClient.SendAlertMessage(" Sit position on restricted land, try another spot");
|
||||
return;
|
||||
}
|
||||
// m_log.InfoFormat("physsit {0} {1}", offset.ToString(),Orientation.ToString());
|
||||
|
||||
RemoveFromPhysicalScene();
|
||||
|
||||
Reference in New Issue
Block a user