Add maximum to barotrauma damage (#4989)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using Content.Server.Alert;
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Shared.Alert;
|
||||
@@ -68,8 +69,16 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
|
||||
_timer -= UpdateTimer;
|
||||
|
||||
foreach (var (barotrauma, transform) in EntityManager.EntityQuery<BarotraumaComponent, ITransformComponent>())
|
||||
foreach (var (barotrauma, damageable, transform) in EntityManager.EntityQuery<BarotraumaComponent, DamageableComponent, ITransformComponent>())
|
||||
{
|
||||
var totalDamage = 0;
|
||||
foreach (var (barotraumaDamageType, _) in barotrauma.Damage.DamageDict)
|
||||
{
|
||||
totalDamage += damageable.Damage.DamageDict[barotraumaDamageType];
|
||||
}
|
||||
if (totalDamage > barotrauma.MaxDamage)
|
||||
continue;
|
||||
|
||||
var uid = barotrauma.Owner.Uid;
|
||||
|
||||
var status = barotrauma.Owner.GetComponentOrNull<ServerAlertsComponent>();
|
||||
|
||||
Reference in New Issue
Block a user