Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ReadExecute perms to all of DamageableComponent #8800

Merged
merged 2 commits into from
Jun 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions Content.Shared/Damage/Components/DamageableComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ namespace Content.Shared.Damage
/// </remarks>
[RegisterComponent]
[NetworkedComponent()]
[Access(typeof(DamageableSystem))]
[Access(typeof(DamageableSystem), Other = AccessPermissions.ReadExecute)]
public sealed class DamageableComponent : Component
{
/// <summary>
/// This <see cref="DamageContainerPrototype"/> specifies what damage types are supported by this component.
/// 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>
Expand All @@ -35,7 +34,6 @@ public sealed class DamageableComponent : Component
/// Though DamageModifierSets can be deserialized directly, we only want to use the prototype version here
/// to reduce duplication.
/// </remarks>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("damageModifierSet", customTypeSerializer: typeof(PrototypeIdSerializer<DamageModifierSetPrototype>))]
public string? DamageModifierSetId;

Expand All @@ -46,8 +44,6 @@ public sealed class DamageableComponent : Component
/// If this data-field is specified, this allows damageable components to be initialized with non-zero damage.
/// </remarks>
[DataField("damage")]
[ViewVariables(VVAccess.ReadWrite)]
[Access(typeof(DamageableSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends
public DamageSpecifier Damage = new();

/// <summary>
Expand All @@ -63,16 +59,10 @@ public sealed class DamageableComponent : Component
/// The sum of all damages in the DamageableComponent.
/// </summary>
[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]
[DataField("radiationDamageTypes", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageTypePrototype>))]
public List<string> RadiationDamageTypeIDs = new() {"Radiation"};
[ViewVariables]
[DataField("explosionDamageTypes", customTypeSerializer: typeof(PrototypeIdListSerializer<DamageTypePrototype>))]
public List<string> ExplosionDamageTypeIDs = new() { "Piercing", "Heat" };
}

[Serializable, NetSerializable]
Expand Down