* 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.
parent
caa255bcdf
commit
1b8e89751a
|
@ -1003,6 +1003,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
AddEntityFromStorage(group);
|
||||
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
||||
rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted;
|
||||
rootPart.TrimPermissions();
|
||||
|
||||
group.ApplyPhysics(m_physicalPrim);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -202,10 +206,18 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
/// <param name="itemId"></param>
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -670,6 +670,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
LLObject.ObjectFlags.AllowInventoryDrop |
|
||||
LLObject.ObjectFlags.CreateSelected;
|
||||
|
||||
|
||||
TrimPermissions();
|
||||
|
||||
ScheduleFullUpdate();
|
||||
|
@ -707,7 +708,11 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
OffsetPosition = position;
|
||||
RotationOffset = rotation;
|
||||
ObjectFlags = flags;
|
||||
|
||||
|
||||
// Since we don't store script state, this is only a 'temporary' objectflag now
|
||||
// If the object is scripted, the script will get loaded and this will be set again
|
||||
ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted;
|
||||
|
||||
TrimPermissions();
|
||||
// ApplyPhysics();
|
||||
|
||||
|
|
Loading…
Reference in New Issue