Handles decay for constructed parts, if enabled.
308 {
309 float healthTarget;
310 float currentHP;
311 float threshold;
312
314 {
315 if (part.IsBuilt() && part.CanPartDecay())
316 {
317 string damageZone;
318 DamageSystem.GetDamageZoneFromComponentName(
m_EntityParent,part.GetPartName(),damageZone);
319 if (damageZone != "")
320 {
322 threshold = part.GetPartDecayThreshold() *
m_EntityParent.GetMaxHealth(damageZone,
"Health");
323 if (currentHP > threshold)
324 {
328 }
329 }
330 }
331 }
332 }
float GetCurrentDecayCoef()
Instanced construction part data classes for dynamic data, statics now stored on EntityType level in ...
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.