mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
Merge branch 'master' into careminster
This commit is contained in:
@@ -2242,7 +2242,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
return NpcCreate(firstname, lastname, position, notecard, true);
|
||||
return NpcCreate(firstname, lastname, position, notecard, false, true);
|
||||
}
|
||||
|
||||
public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options)
|
||||
@@ -2250,10 +2250,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
return NpcCreate(firstname, lastname, position, notecard, (options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0);
|
||||
return NpcCreate(
|
||||
firstname, lastname, position, notecard,
|
||||
(options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0,
|
||||
(options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) == 0);
|
||||
}
|
||||
|
||||
private LSL_Key NpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, bool owned)
|
||||
private LSL_Key NpcCreate(
|
||||
string firstname, string lastname, LSL_Vector position, string notecard, bool owned, bool senseAsAgent)
|
||||
{
|
||||
if (!owned)
|
||||
OSSLError("Unowned NPCs are unsupported");
|
||||
@@ -2301,7 +2305,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
lastname,
|
||||
new Vector3((float) position.x, (float) position.y, (float) position.z),
|
||||
ownerID,
|
||||
World,appearance);
|
||||
senseAsAgent,
|
||||
World,
|
||||
appearance);
|
||||
|
||||
ScenePresence sp;
|
||||
if (World.TryGetScenePresence(x, out sp))
|
||||
|
||||
@@ -452,9 +452,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
|
||||
Action<ScenePresence> senseEntity = new Action<ScenePresence>(delegate(ScenePresence presence)
|
||||
{
|
||||
if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc)
|
||||
if ((ts.type & NPC) == 0
|
||||
&& presence.PresenceType == PresenceType.Npc
|
||||
&& !npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent)
|
||||
return;
|
||||
if ((ts.type & AGENT) == 0 && presence.PresenceType == PresenceType.User)
|
||||
|
||||
if ((ts.type & AGENT) == 0
|
||||
&& (presence.PresenceType == PresenceType.User
|
||||
|| npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent))
|
||||
return;
|
||||
|
||||
if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0)
|
||||
|
||||
@@ -619,6 +619,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
|
||||
public const int OS_NPC_CREATOR_OWNED = 0x1;
|
||||
public const int OS_NPC_NOT_OWNED = 0x2;
|
||||
public const int OS_NPC_SENSE_AS_AGENT = 0x4;
|
||||
|
||||
public const string URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED";
|
||||
public const string URL_REQUEST_DENIED = "URL_REQUEST_DENIED";
|
||||
|
||||
Reference in New Issue
Block a user