diff options
author | UbitUmarov | 2016-06-28 18:14:30 +0100 |
---|---|---|
committer | UbitUmarov | 2016-06-28 18:14:30 +0100 |
commit | a08c354a0737aa1c39e8abd1bc77446c5ace2997 (patch) | |
tree | 5d26160d350397acc53da256d426548d2825f169 | |
parent | mantis: 7936 replace httpServer_OpenSim.dll with a new one restoring some ch... (diff) | |
download | opensim-SC_OLD-a08c354a0737aa1c39e8abd1bc77446c5ace2997.zip opensim-SC_OLD-a08c354a0737aa1c39e8abd1bc77446c5ace2997.tar.gz opensim-SC_OLD-a08c354a0737aa1c39e8abd1bc77446c5ace2997.tar.bz2 opensim-SC_OLD-a08c354a0737aa1c39e8abd1bc77446c5ace2997.tar.xz |
fix NPCs OS_NPC_OBJECT_GROUP option. group ID needs to be set during creation, before scenepresence.CompleteMovement, set tittle just after it.
3 files changed, 9 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs index a40f150..14610ff 100644 --- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs +++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs | |||
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
107 | /// failure. | 107 | /// failure. |
108 | /// </returns> | 108 | /// </returns> |
109 | UUID CreateNPC(string firstname, string lastname, | 109 | UUID CreateNPC(string firstname, string lastname, |
110 | Vector3 position, UUID agentID, UUID owner, bool senseAsAgent, Scene scene, | 110 | Vector3 position, UUID agentID, UUID owner, string groupTitle, UUID groupID, bool senseAsAgent, Scene scene, |
111 | AvatarAppearance appearance); | 111 | AvatarAppearance appearance); |
112 | 112 | ||
113 | /// <summary> | 113 | /// <summary> |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index d40fa48..8462661 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -157,14 +157,14 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
157 | } | 157 | } |
158 | 158 | ||
159 | public UUID CreateNPC(string firstname, string lastname, | 159 | public UUID CreateNPC(string firstname, string lastname, |
160 | Vector3 position, UUID owner, bool senseAsAgent, Scene scene, | 160 | Vector3 position, UUID owner, bool senseAsAgent, Scene scene, |
161 | AvatarAppearance appearance) | 161 | AvatarAppearance appearance) |
162 | { | 162 | { |
163 | return CreateNPC(firstname, lastname, position, UUID.Zero, owner, senseAsAgent, scene, appearance); | 163 | return CreateNPC(firstname, lastname, position, UUID.Zero, owner, "", UUID.Zero, senseAsAgent, scene, appearance); |
164 | } | 164 | } |
165 | 165 | ||
166 | public UUID CreateNPC(string firstname, string lastname, | 166 | public UUID CreateNPC(string firstname, string lastname, |
167 | Vector3 position, UUID agentID, UUID owner, bool senseAsAgent, Scene scene, | 167 | Vector3 position, UUID agentID, UUID owner, string groupTitle, UUID groupID, bool senseAsAgent, Scene scene, |
168 | AvatarAppearance appearance) | 168 | AvatarAppearance appearance) |
169 | { | 169 | { |
170 | NPCAvatar npcAvatar = null; | 170 | NPCAvatar npcAvatar = null; |
@@ -222,8 +222,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
222 | ScenePresence sp; | 222 | ScenePresence sp; |
223 | if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) | 223 | if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) |
224 | { | 224 | { |
225 | 225 | npcAvatar.ActiveGroupId = groupID; | |
226 | sp.CompleteMovement(npcAvatar, false); | 226 | sp.CompleteMovement(npcAvatar, false); |
227 | sp.Grouptitle = groupTitle; | ||
227 | m_avatars.Add(npcAvatar.AgentId, npcAvatar); | 228 | m_avatars.Add(npcAvatar.AgentId, npcAvatar); |
228 | // m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name); | 229 | // m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name); |
229 | } | 230 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 5b5c257..90b7494 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2748,7 +2748,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2748 | UUID x = module.CreateNPC(firstname, | 2748 | UUID x = module.CreateNPC(firstname, |
2749 | lastname, | 2749 | lastname, |
2750 | position, | 2750 | position, |
2751 | UUID.Random(), | ||
2751 | ownerID, | 2752 | ownerID, |
2753 | groupTitle, | ||
2754 | groupID, | ||
2752 | senseAsAgent, | 2755 | senseAsAgent, |
2753 | World, | 2756 | World, |
2754 | appearance); | 2757 | appearance); |
@@ -2756,9 +2759,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2756 | ScenePresence sp; | 2759 | ScenePresence sp; |
2757 | if (World.TryGetScenePresence(x, out sp)) | 2760 | if (World.TryGetScenePresence(x, out sp)) |
2758 | { | 2761 | { |
2759 | sp.Grouptitle = groupTitle; | ||
2760 | ((INPC)(sp.ControllingClient)).ActiveGroupId = groupID; | ||
2761 | |||
2762 | sp.SendAvatarDataToAllAgents(); | 2762 | sp.SendAvatarDataToAllAgents(); |
2763 | } | 2763 | } |
2764 | return new LSL_Key(x.ToString()); | 2764 | return new LSL_Key(x.ToString()); |