Revert "Revert "Fix some friend access violations by allowing others access. (#8594) (#8703)" (working this time) (#8704)

This commit is contained in:
Pieter-Jan Briers
2022-06-07 15:26:28 +02:00
committed by GitHub
parent cecf87997b
commit a323ba8223
164 changed files with 199 additions and 171 deletions

View File

@@ -16,7 +16,7 @@ namespace Content.Shared.Damage
/// </remarks>
[RegisterComponent]
[NetworkedComponent()]
[Friend(typeof(DamageableSystem))]
[Access(typeof(DamageableSystem))]
public sealed class DamageableComponent : Component
{
/// <summary>
@@ -24,6 +24,7 @@ namespace Content.Shared.Damage
/// If null, all damage types will be supported.
/// </summary>
[DataField("damageContainer", customTypeSerializer: typeof(PrototypeIdSerializer<DamageContainerPrototype>))]
[Access(typeof(DamageableSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends
public string? DamageContainerID;
/// <summary>
@@ -46,6 +47,7 @@ namespace Content.Shared.Damage
/// </remarks>
[DataField("damage")]
[ViewVariables(VVAccess.ReadWrite)]
[Access(typeof(DamageableSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends
public DamageSpecifier Damage = new();
/// <summary>
@@ -60,7 +62,9 @@ namespace Content.Shared.Damage
/// <summary>
/// The sum of all damages in the DamageableComponent.
/// </summary>
[ViewVariables] public FixedPoint2 TotalDamage;
[ViewVariables]
[Access(typeof(DamageableSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends
public FixedPoint2 TotalDamage;
// Really these shouldn't be here. OnExplosion() and RadiationAct() should be handled elsewhere.
[ViewVariables]