diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index b724bda..c6b3059 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -2752,6 +2752,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
2752 | PhysActor.OnCollisionUpdate -= PhysicsCollision; | 2752 | PhysActor.OnCollisionUpdate -= PhysicsCollision; |
2753 | } | 2753 | } |
2754 | } | 2754 | } |
2755 | if ((GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Scripted) != 0) | ||
2756 | { | ||
2757 | m_parentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting; | ||
2758 | } | ||
2759 | else | ||
2760 | { | ||
2761 | m_parentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting; | ||
2762 | } | ||
2755 | 2763 | ||
2756 | LocalFlags=(LLObject.ObjectFlags)objectflagupdate; | 2764 | LocalFlags=(LLObject.ObjectFlags)objectflagupdate; |
2757 | 2765 | ||
@@ -2812,6 +2820,30 @@ namespace OpenSim.Region.Environment.Scenes | |||
2812 | GetProperties(client); | 2820 | GetProperties(client); |
2813 | m_updateFlag = 2; | 2821 | m_updateFlag = 2; |
2814 | } | 2822 | } |
2823 | private void handleTimerAccounting(uint localID, double interval) | ||
2824 | { | ||
2825 | if (localID == LocalId) | ||
2826 | { | ||
2827 | |||
2828 | float sec = (float)interval; | ||
2829 | if (m_parentGroup != null) | ||
2830 | { | ||
2831 | if (sec == 0) | ||
2832 | { | ||
2833 | if (m_parentGroup.scriptScore + 0.001f >= float.MaxValue - 0.001) | ||
2834 | m_parentGroup.scriptScore = 0; | ||
2835 | |||
2836 | m_parentGroup.scriptScore += 0.001f; | ||
2837 | return; | ||
2838 | } | ||
2839 | |||
2840 | if (m_parentGroup.scriptScore + (0.001f / sec) >= float.MaxValue - (0.001f / sec)) | ||
2841 | m_parentGroup.scriptScore = 0; | ||
2842 | m_parentGroup.scriptScore += (0.001f / sec); | ||
2843 | } | ||
2844 | |||
2845 | } | ||
2846 | } | ||
2815 | 2847 | ||
2816 | } | 2848 | } |
2817 | } | 2849 | } |