diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 8618a66..5ea950d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -343,6 +343,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
343 | private const float FLY_ROLL_RESET_RADIANS_PER_UPDATE = 0.02f; | 343 | private const float FLY_ROLL_RESET_RADIANS_PER_UPDATE = 0.02f; |
344 | 344 | ||
345 | private float m_health = 100f; | 345 | private float m_health = 100f; |
346 | private float m_healRate = 1f; | ||
347 | private float m_healRatePerFrame = 0.05f; | ||
346 | 348 | ||
347 | protected ulong crossingFromRegion; | 349 | protected ulong crossingFromRegion; |
348 | 350 | ||
@@ -861,6 +863,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
861 | set { m_health = value; } | 863 | set { m_health = value; } |
862 | } | 864 | } |
863 | 865 | ||
866 | public float HealRate | ||
867 | { | ||
868 | get { return m_healRate; } | ||
869 | set | ||
870 | { | ||
871 | if(value > 100.0f) | ||
872 | m_healRate = 100.0f; | ||
873 | else if (value <= 0.0) | ||
874 | m_healRate = 0.0f; | ||
875 | else | ||
876 | m_healRate = value; | ||
877 | |||
878 | if(Scene != null) | ||
879 | m_healRatePerFrame = m_healRate * Scene.FrameTime; | ||
880 | else | ||
881 | m_healRatePerFrame = 0.05f; | ||
882 | } | ||
883 | } | ||
884 | |||
885 | |||
864 | /// <summary> | 886 | /// <summary> |
865 | /// Gets the world rotation of this presence. | 887 | /// Gets the world rotation of this presence. |
866 | /// </summary> | 888 | /// </summary> |
@@ -1064,6 +1086,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1064 | 1086 | ||
1065 | m_stateMachine = new ScenePresenceStateMachine(this); | 1087 | m_stateMachine = new ScenePresenceStateMachine(this); |
1066 | 1088 | ||
1089 | HealRate = 0.5f; | ||
1090 | |||
1067 | IConfig sconfig = m_scene.Config.Configs["EntityTransfer"]; | 1091 | IConfig sconfig = m_scene.Config.Configs["EntityTransfer"]; |
1068 | if (sconfig != null) | 1092 | if (sconfig != null) |
1069 | { | 1093 | { |
@@ -1102,10 +1126,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1102 | } | 1126 | } |
1103 | } | 1127 | } |
1104 | 1128 | ||
1105 | if(Health != 100.0f) | 1129 | if(m_healRatePerFrame != 0f && Health != 100.0f) |
1106 | { | 1130 | { |
1107 | float last = Health; | 1131 | float last = Health; |
1108 | Health += 0.05f; | 1132 | Health += m_healRatePerFrame; |
1109 | if(Health > 100.0f) | 1133 | if(Health > 100.0f) |
1110 | { | 1134 | { |
1111 | Health = 100.0f; | 1135 | Health = 100.0f; |