mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Implement osIsNpc(key npc):integer. This return TRUE if the given key belongs to an NPC in the region. FALSE if not or if the NPC module isn't present.
This commit is contained in:
@@ -2202,6 +2202,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public LSL_Integer osIsNpc(LSL_Key npc)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osIsNpc");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
INPCModule module = World.RequestModuleInterface<INPCModule>();
|
||||
if (module != null)
|
||||
{
|
||||
UUID npcId;
|
||||
if (UUID.TryParse(npc.m_string, out npcId))
|
||||
if (module.IsNPC(npcId, World))
|
||||
return ScriptBaseClass.TRUE;
|
||||
}
|
||||
|
||||
return ScriptBaseClass.FALSE;
|
||||
}
|
||||
|
||||
public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
|
||||
|
||||
Reference in New Issue
Block a user