exclude npcs from baked cache

avinationmerge
UbitUmarov 2014-09-19 16:51:51 +01:00
parent 242bb425f3
commit 9c552212a9
2 changed files with 24 additions and 7 deletions

View File

@ -366,6 +366,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// called on textures update
public bool UpdateBakedTextureCache(IScenePresence sp, WearableCacheItem[] cacheItems)
{
// npcs dont have baked cache
if (((ScenePresence)sp).isNPC)
return true;
// uploaded baked textures will be in assets local cache
IAssetService cache = m_scene.AssetService;
@ -485,6 +489,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
{
int hits = 0;
if (((ScenePresence)sp).isNPC)
return true;
lock (m_setAppearanceLock)
{
IAssetService cache = m_scene.AssetService;
@ -650,6 +657,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
public int RequestRebake(IScenePresence sp, bool missingTexturesOnly)
{
if (((ScenePresence)sp).isNPC)
return 0;
int texturesRebaked = 0;
IImprovedAssetCache cache = m_scene.RequestModuleInterface<IImprovedAssetCache>();

View File

@ -1703,6 +1703,7 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat("[CompleteMovement] WaitForUpdateAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
if (!MakeRootAgent(AbsolutePosition, flying))
{
m_log.DebugFormat(
@ -1724,7 +1725,7 @@ namespace OpenSim.Region.Framework.Scenes
look = new Vector3(0.99f, 0.042f, 0);
}
if (!IsChildAgent)
if (!IsChildAgent && !isNPC)
{
InventoryFolderBase cof = m_scene.InventoryService.GetFolderForType(client.AgentId, (AssetType)46);
if (cof == null)
@ -1790,8 +1791,13 @@ namespace OpenSim.Region.Framework.Scenes
// verify baked textures and cache
bool cachedbaked = false;
if (isNPC)
cachedbaked = true;
else
{
if (m_scene.AvatarFactory != null)
cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this);
@ -1801,6 +1807,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_scene.AvatarFactory != null)
m_scene.AvatarFactory.QueueAppearanceSave(UUID);
}
}
List<ScenePresence> allpresences = m_scene.GetScenePresences();