Rejuvenate cures all diseases (#7495)
This commit is contained in:
@@ -2,6 +2,8 @@ using Content.Server.Atmos.Components;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Server.Disease.Components;
|
||||
using Content.Server.Disease;
|
||||
using Content.Server.Nutrition.Components;
|
||||
using Content.Server.Nutrition.EntitySystems;
|
||||
using Content.Shared.Administration;
|
||||
@@ -12,9 +14,7 @@ using Content.Shared.Nutrition.Components;
|
||||
using Content.Shared.StatusEffect;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
|
||||
|
||||
namespace Content.Server.Administration.Commands
|
||||
{
|
||||
@@ -89,6 +89,11 @@ namespace Content.Server.Administration.Commands
|
||||
{
|
||||
entMan.RemoveComponent<JitteringComponent>(target);
|
||||
}
|
||||
|
||||
if (entMan.TryGetComponent<DiseaseCarrierComponent>(target, out var carrier))
|
||||
{
|
||||
EntitySystem.Get<DiseaseSystem>().CureAllDiseases(target, carrier);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,6 +189,17 @@ namespace Content.Server.Disease
|
||||
_popupSystem.PopupEntity(Loc.GetString("disease-cured"), carrier.Owner, Filter.Entities(carrier.Owner));
|
||||
}
|
||||
|
||||
public void CureAllDiseases(EntityUid uid, DiseaseCarrierComponent? carrier = null)
|
||||
{
|
||||
if (!Resolve(uid, ref carrier))
|
||||
return;
|
||||
|
||||
foreach (var disease in carrier.Diseases)
|
||||
{
|
||||
CureDisease(carrier, disease);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when someone interacts with a diseased person with an empty hand
|
||||
/// to check if they get infected
|
||||
|
||||
Reference in New Issue
Block a user