Add maximum to barotrauma damage (#4989)

This commit is contained in:
ShadowCommander
2021-10-23 11:45:57 -07:00
committed by GitHub
parent 5fb8960a3a
commit 6c1ba187e3
2 changed files with 14 additions and 1 deletions

View File

@@ -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>();