Skip to content

Commit

Permalink
Rename PackPrototypeID to Pack in both components.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tayrtahn committed Mar 25, 2024
1 parent d825df0 commit cf563c5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Content.Server/Advertise/Components/AdvertiseComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public sealed partial class AdvertiseComponent : Component
/// <summary>
/// The identifier for the advertisements pack prototype.
/// </summary>
[DataField("pack", required: true)]
public ProtoId<MessagePackPrototype> PackPrototypeId { get; private set; }
[DataField(required: true)]
public ProtoId<MessagePackPrototype> Pack { get; private set; }

/// <summary>
/// The next time an advertisement will be said.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public sealed partial class SpeakOnUIClosedComponent : Component
/// <summary>
/// The identifier for the message pack prototype containing messages to be spoken by this entity.
/// </summary>
[DataField("pack", required: true)]
public ProtoId<MessagePackPrototype> PackPrototypeId { get; private set; }
[DataField(required: true)]
public ProtoId<MessagePackPrototype> Pack { get; private set; }

/// <summary>
/// Is this component active? If false, no messages will be spoken.
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Advertise/EntitySystems/AdvertiseSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void SayAdvertisement(EntityUid uid, AdvertiseComponent? advertise = null
if (!Resolve(uid, ref advertise))
return;

if (_prototypeManager.TryIndex(advertise.PackPrototypeId, out var advertisements))
if (_prototypeManager.TryIndex(advertise.Pack, out var advertisements))
_chat.TrySendInGameICMessage(uid, Loc.GetString(_random.Pick(advertisements.Messages)), InGameICChatType.Speak, hideChat: true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public bool TrySpeak(Entity<SpeakOnUIClosedComponent?> entity)
if (!entity.Comp.Enabled)
return false;

if (!_prototypeManager.TryIndex(entity.Comp.PackPrototypeId, out MessagePackPrototype? messagePack))
if (!_prototypeManager.TryIndex(entity.Comp.Pack, out MessagePackPrototype? messagePack))
return false;

var message = Loc.GetString(_random.Pick(messagePack.Messages), ("name", Name(entity)));
Expand Down

0 comments on commit cf563c5

Please sign in to comment.