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/OptionalModules/World/NPC/Tests | |
parent | Split out to-be-common setup stuff from TestOsOwnerSaveAppearance() (diff) | |
download | opensim-SC-50945dd56029a1280c581ea9b29213ab0e162a0a.zip opensim-SC-50945dd56029a1280c581ea9b29213ab0e162a0a.tar.gz opensim-SC-50945dd56029a1280c581ea9b29213ab0e162a0a.tar.bz2 opensim-SC-50945dd56029a1280c581ea9b29213ab0e162a0a.tar.xz |
add regression test for osNpcCreate when cloning an in-region avatar
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/NPC/Tests')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs index 2742b67..f8afc5a 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
59 | AvatarFactoryModule afm = new AvatarFactoryModule(); | 59 | AvatarFactoryModule afm = new AvatarFactoryModule(); |
60 | TestScene scene = SceneHelpers.SetupScene(); | 60 | TestScene scene = SceneHelpers.SetupScene(); |
61 | SceneHelpers.SetupSceneModules(scene, config, afm, new NPCModule()); | 61 | SceneHelpers.SetupSceneModules(scene, config, afm, new NPCModule()); |
62 | IClientAPI originalClient = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)).ControllingClient; | 62 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); |
63 | // ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); | 63 | // ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); |
64 | 64 | ||
65 | // 8 is the index of the first baked texture in AvatarAppearance | 65 | // 8 is the index of the first baked texture in AvatarAppearance |
@@ -72,10 +72,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
72 | // ScenePresence.SendInitialData() to reset our entire appearance. | 72 | // ScenePresence.SendInitialData() to reset our entire appearance. |
73 | scene.AssetService.Store(AssetHelpers.CreateAsset(originalFace8TextureId)); | 73 | scene.AssetService.Store(AssetHelpers.CreateAsset(originalFace8TextureId)); |
74 | 74 | ||
75 | afm.SetAppearanceFromClient(originalClient, originalTe, null); | 75 | afm.SetAppearanceFromClient(sp.ControllingClient, originalTe, null); |
76 | 76 | ||
77 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 77 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
78 | UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), scene, originalClient.AgentId); | 78 | UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), scene, sp.Appearance); |
79 | 79 | ||
80 | ScenePresence npc = scene.GetScenePresence(npcId); | 80 | ScenePresence npc = scene.GetScenePresence(npcId); |
81 | 81 | ||
@@ -96,12 +96,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
96 | 96 | ||
97 | TestScene scene = SceneHelpers.SetupScene(); | 97 | TestScene scene = SceneHelpers.SetupScene(); |
98 | SceneHelpers.SetupSceneModules(scene, config, new NPCModule()); | 98 | SceneHelpers.SetupSceneModules(scene, config, new NPCModule()); |
99 | IClientAPI originalClient = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)).ControllingClient; | 99 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); |
100 | // ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); | 100 | // ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId); |
101 | 101 | ||
102 | Vector3 startPos = new Vector3(128, 128, 30); | 102 | Vector3 startPos = new Vector3(128, 128, 30); |
103 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | 103 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); |
104 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, originalClient.AgentId); | 104 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, sp.Appearance); |
105 | 105 | ||
106 | ScenePresence npc = scene.GetScenePresence(npcId); | 106 | ScenePresence npc = scene.GetScenePresence(npcId); |
107 | Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); | 107 | Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); |