From 1b8e89751a40ba7bcb1e068f60d4d5228d31f4ce Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 7 Feb 2008 01:52:39 +0000 Subject: * Added the Scripted objectflag if there is a script running in a prim. Remove the flag if you delete all of the scripts in the object. --- .../Environment/Scenes/SceneObjectPart.Inventory.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index e74b8ed..94bf10e 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -151,12 +151,15 @@ namespace OpenSim.Region.Environment.Scenes // "[PRIMINVENTORY]: " + // "Starting script {0}, {1} in prim {2}, {3}", // item.Name, item.ItemID, Name, UUID)); + AddFlag(LLObject.ObjectFlags.Scripted); + if (!((m_parentGroup.Scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts)) { AssetBase rezAsset = m_parentGroup.Scene.AssetCache.GetAsset(item.AssetID, false); if (rezAsset != null) { + string script = Helpers.FieldToUTF8String(rezAsset.Data); m_parentGroup.Scene.EventManager.TriggerRezScript(LocalID, item.ItemID, script); m_parentGroup.AddActiveScriptCount(1); @@ -169,6 +172,7 @@ namespace OpenSim.Region.Environment.Scenes item.Name, item.ItemID, item.AssetID)); } } + ScheduleFullUpdate(); } /// @@ -202,10 +206,18 @@ namespace OpenSim.Region.Environment.Scenes /// public void StopScript(LLUUID itemId) { + + if (m_taskInventory.ContainsKey(itemId)) { + m_parentGroup.Scene.EventManager.TriggerRemoveScript(LocalID, itemId); m_parentGroup.AddActiveScriptCount(-1); + + + + + } else { @@ -213,7 +225,8 @@ namespace OpenSim.Region.Environment.Scenes "[PRIMINVENTORY]: " + "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2}", itemId, Name, UUID)); - } + } + } /// -- cgit v1.1