add regression test for osNpcCreate when cloning an in-region avatar

This commit is contained in:
Justin Clark-Casey (justincc)
2011-08-11 21:43:26 +01:00
parent 83ca5a101d
commit 50945dd560
6 changed files with 89 additions and 41 deletions

View File

@@ -2135,11 +2135,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
{
ScenePresence clonePresence = World.GetScenePresence(new UUID(cloneFrom.m_string));
if (clonePresence == null)
return new LSL_Key(UUID.Zero.ToString());
UUID x = module.CreateNPC(firstname,
lastname,
new Vector3((float) position.x, (float) position.y, (float) position.z),
World,
new UUID(cloneFrom));
clonePresence.Appearance);
return new LSL_Key(x.ToString());
}