diff options
author | Justin Clark-Casey (justincc) | 2011-08-11 21:43:26 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-11 21:43:26 +0100 |
commit | 50945dd56029a1280c581ea9b29213ab0e162a0a (patch) | |
tree | 826067de13242de2e3137ef68cfae4f87c6c59b8 /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | Split out to-be-common setup stuff from TestOsOwnerSaveAppearance() (diff) | |
download | opensim-SC_OLD-50945dd56029a1280c581ea9b29213ab0e162a0a.zip opensim-SC_OLD-50945dd56029a1280c581ea9b29213ab0e162a0a.tar.gz opensim-SC_OLD-50945dd56029a1280c581ea9b29213ab0e162a0a.tar.bz2 opensim-SC_OLD-50945dd56029a1280c581ea9b29213ab0e162a0a.tar.xz |
add regression test for osNpcCreate when cloning an in-region avatar
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 91ac3b7..b18aa3b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2135,11 +2135,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2135 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | 2135 | INPCModule module = World.RequestModuleInterface<INPCModule>(); |
2136 | if (module != null) | 2136 | if (module != null) |
2137 | { | 2137 | { |
2138 | ScenePresence clonePresence = World.GetScenePresence(new UUID(cloneFrom.m_string)); | ||
2139 | if (clonePresence == null) | ||
2140 | return new LSL_Key(UUID.Zero.ToString()); | ||
2141 | |||
2138 | UUID x = module.CreateNPC(firstname, | 2142 | UUID x = module.CreateNPC(firstname, |
2139 | lastname, | 2143 | lastname, |
2140 | new Vector3((float) position.x, (float) position.y, (float) position.z), | 2144 | new Vector3((float) position.x, (float) position.y, (float) position.z), |
2141 | World, | 2145 | World, |
2142 | new UUID(cloneFrom)); | 2146 | clonePresence.Appearance); |
2143 | 2147 | ||
2144 | return new LSL_Key(x.ToString()); | 2148 | return new LSL_Key(x.ToString()); |
2145 | } | 2149 | } |