diff options
author | UbitUmarov | 2018-12-11 18:23:26 +0000 |
---|---|---|
committer | UbitUmarov | 2018-12-11 18:23:26 +0000 |
commit | d6c9ddfdeebf8c18daacb421ab59a2bcd6481ab2 (patch) | |
tree | 66885913b03520bd8d8b81acef32977d35f67dd0 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |
parent | Add osNpcSayTo(key npc, key target, integer channel, string message) (diff) | |
download | opensim-SC-d6c9ddfdeebf8c18daacb421ab59a2bcd6481ab2.zip opensim-SC-d6c9ddfdeebf8c18daacb421ab59a2bcd6481ab2.tar.gz opensim-SC-d6c9ddfdeebf8c18daacb421ab59a2bcd6481ab2.tar.bz2 opensim-SC-d6c9ddfdeebf8c18daacb421ab59a2bcd6481ab2.tar.xz |
cleanup last patch
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 7c43b6a..3c824eb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3164,33 +3164,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3164 | module.Say(npcId, World, message, channel); | 3164 | module.Say(npcId, World, message, channel); |
3165 | } | 3165 | } |
3166 | } | 3166 | } |
3167 | 3167 | ||
3168 | public void osNpcSayTo(LSL_Key npc, string target, int channel, string msg) | 3168 | public void osNpcSayTo(LSL_Key npc, LSL_Key target, int channel, string msg) |
3169 | { | 3169 | { |
3170 | CheckThreatLevel(ThreatLevel.High, "osNpcSayTo"); | 3170 | CheckThreatLevel(ThreatLevel.High, "osNpcSayTo"); |
3171 | 3171 | ||
3172 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 3172 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
3173 | if (module != null) | 3173 | if (module == null) |
3174 | { | 3174 | return; |
3175 | UUID npcId = new UUID(npc.m_string); | 3175 | |
3176 | UUID npcId; | ||
3177 | if (!UUID.TryParse(npc.m_string, out npcId)) | ||
3178 | return; | ||
3176 | 3179 | ||
3177 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | ||
3178 | return; | ||
3179 | |||
3180 | ScenePresence NPCpresence = World.GetScenePresence(npcId); | ||
3181 | if (NPCpresence == null || NPCpresence.IsDeleted) | ||
3182 | return; | ||
3183 | |||
3184 | Vector3 npcPOS = NPCpresence.AbsolutePosition; | ||
3185 | string npcNAME = NPCpresence.Name; | ||
3186 | UUID TargetID; | 3180 | UUID TargetID; |
3187 | UUID.TryParse(target, out TargetID); | 3181 | if (!UUID.TryParse(target.m_string, out TargetID)) |
3188 | 3182 | return; | |
3189 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 3183 | |
3184 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | ||
3185 | return; | ||
3186 | |||
3187 | ScenePresence NPCpresence = World.GetScenePresence(npcId); | ||
3188 | if (NPCpresence == null || NPCpresence.IsDeleted || !NPCpresence.IsNPC) | ||
3189 | return; | ||
3190 | |||
3191 | Vector3 npcPOS = NPCpresence.AbsolutePosition; | ||
3192 | string npcNAME = NPCpresence.Name; | ||
3193 | |||
3194 | IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | ||
3190 | if (wComm != null) | 3195 | if (wComm != null) |
3191 | wComm.DeliverMessageTo(TargetID, channel, npcPOS, npcNAME, npcId, msg); | 3196 | wComm.DeliverMessageTo(TargetID, channel, npcPOS, npcNAME, npcId, msg); |
3192 | } | ||
3193 | } | 3197 | } |
3198 | |||
3194 | public void osNpcShout(LSL_Key npc, int channel, string message) | 3199 | public void osNpcShout(LSL_Key npc, int channel, string message) |
3195 | { | 3200 | { |
3196 | CheckThreatLevel(ThreatLevel.High, "osNpcShout"); | 3201 | CheckThreatLevel(ThreatLevel.High, "osNpcShout"); |