Modify damage logging. (#5579)

This commit is contained in:
Leon Friedrich
2021-11-29 02:34:44 +13:00
committed by GitHub
parent b807250021
commit 0de4b7bc9f
28 changed files with 265 additions and 62 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Content.Server.Administration.Logs;
using Content.Server.Alert;
using Content.Server.Atmos;
using Content.Server.Atmos.EntitySystems;
@@ -8,6 +9,7 @@ using Content.Server.Body.Behavior;
using Content.Server.Temperature.Components;
using Content.Server.Temperature.Systems;
using Content.Shared.ActionBlocker;
using Content.Shared.Administration.Logs;
using Content.Shared.Alert;
using Content.Shared.Atmos;
using Content.Shared.Body.Components;
@@ -313,6 +315,9 @@ namespace Content.Server.Body.Components
private void TakeSuffocationDamage()
{
if (!Suffocating)
EntitySystem.Get<AdminLogSystem>().Add(LogType.Asphyxiation, $"{Owner} started suffocating");
Suffocating = true;
if (Owner.TryGetComponent(out ServerAlertsComponent? alertsComponent))
@@ -325,6 +330,9 @@ namespace Content.Server.Body.Components
private void StopSuffocation()
{
if (Suffocating)
EntitySystem.Get<AdminLogSystem>().Add(LogType.Asphyxiation, $"{Owner} stopped suffocating");
Suffocating = false;
if (Owner.TryGetComponent(out ServerAlertsComponent? alertsComponent))