Support multiple containers for HealingComponent (#16867)

This commit is contained in:
Vordenburg
2023-06-03 15:30:20 -04:00
committed by GitHub
parent d8c05d013e
commit 49ba959b82
4 changed files with 23 additions and 12 deletions

View File

@@ -51,8 +51,12 @@ public sealed class HealingSystem : EntitySystem
if (args.Handled || args.Cancelled)
return;
if (component.DamageContainerID is not null && !component.DamageContainerID.Equals(component.DamageContainerID))
if (healing.DamageContainers is not null &&
component.DamageContainerID is not null &&
!healing.DamageContainers.Contains(component.DamageContainerID))
{
return;
}
// Heal some bloodloss damage.
if (healing.BloodlossModifier != 0)
@@ -140,9 +144,12 @@ public sealed class HealingSystem : EntitySystem
if (!TryComp<DamageableComponent>(target, out var targetDamage))
return false;
if (component.DamageContainerID is not null &&
!component.DamageContainerID.Equals(targetDamage.DamageContainerID))
if (component.DamageContainers is not null &&
targetDamage.DamageContainerID is not null &&
!component.DamageContainers.Contains(targetDamage.DamageContainerID))
{
return false;
}
if (user != target && !_interactionSystem.InRangeUnobstructed(user, target, popup: true))
return false;