fix NPCs OS_NPC_OBJECT_GROUP option. group ID needs to be set during creation, before scenepresence.CompleteMovement, set tittle just after it.
parent
5143bbc9d6
commit
a08c354a07
|
@ -107,7 +107,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
|||
/// failure.
|
||||
/// </returns>
|
||||
UUID CreateNPC(string firstname, string lastname,
|
||||
Vector3 position, UUID agentID, UUID owner, bool senseAsAgent, Scene scene,
|
||||
Vector3 position, UUID agentID, UUID owner, string groupTitle, UUID groupID, bool senseAsAgent, Scene scene,
|
||||
AvatarAppearance appearance);
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -157,14 +157,14 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
|||
}
|
||||
|
||||
public UUID CreateNPC(string firstname, string lastname,
|
||||
Vector3 position, UUID owner, bool senseAsAgent, Scene scene,
|
||||
Vector3 position, UUID owner, bool senseAsAgent, Scene scene,
|
||||
AvatarAppearance appearance)
|
||||
{
|
||||
return CreateNPC(firstname, lastname, position, UUID.Zero, owner, senseAsAgent, scene, appearance);
|
||||
return CreateNPC(firstname, lastname, position, UUID.Zero, owner, "", UUID.Zero, senseAsAgent, scene, appearance);
|
||||
}
|
||||
|
||||
public UUID CreateNPC(string firstname, string lastname,
|
||||
Vector3 position, UUID agentID, UUID owner, bool senseAsAgent, Scene scene,
|
||||
Vector3 position, UUID agentID, UUID owner, string groupTitle, UUID groupID, bool senseAsAgent, Scene scene,
|
||||
AvatarAppearance appearance)
|
||||
{
|
||||
NPCAvatar npcAvatar = null;
|
||||
|
@ -222,8 +222,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
|||
ScenePresence sp;
|
||||
if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp))
|
||||
{
|
||||
|
||||
npcAvatar.ActiveGroupId = groupID;
|
||||
sp.CompleteMovement(npcAvatar, false);
|
||||
sp.Grouptitle = groupTitle;
|
||||
m_avatars.Add(npcAvatar.AgentId, npcAvatar);
|
||||
// m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name);
|
||||
}
|
||||
|
|
|
@ -2748,7 +2748,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
UUID x = module.CreateNPC(firstname,
|
||||
lastname,
|
||||
position,
|
||||
UUID.Random(),
|
||||
ownerID,
|
||||
groupTitle,
|
||||
groupID,
|
||||
senseAsAgent,
|
||||
World,
|
||||
appearance);
|
||||
|
@ -2756,9 +2759,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
ScenePresence sp;
|
||||
if (World.TryGetScenePresence(x, out sp))
|
||||
{
|
||||
sp.Grouptitle = groupTitle;
|
||||
((INPC)(sp.ControllingClient)).ActiveGroupId = groupID;
|
||||
|
||||
sp.SendAvatarDataToAllAgents();
|
||||
}
|
||||
return new LSL_Key(x.ToString());
|
||||
|
|
Loading…
Reference in New Issue