Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Spatison committed May 31, 2024
1 parent b18f3ab commit 0ffca73
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 23 deletions.
13 changes: 6 additions & 7 deletions Content.Server/Pinpointer/PinpointerSystem.multiple.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Linq;
using Content.Shared.Interaction;
using Content.Shared.Pinpointer;
using Robust.Shared.Utility;
Expand All @@ -25,7 +24,7 @@ private void OnMultiplePinpointerStartup(EntityUid uid, MultiplePinpointerCompon
SetMultiplePinpointer(uid, multiple, tool);
else
{
Log.Error($"{MetaData(uid).EntityPrototype?.ID}({uid.Id}) does not have a Pinpointer component");
Log.Warning($"{MetaData(uid).EntityPrototype?.ID}({uid.Id}) does not have a Pinpointer component");
DebugTools.Assert(false);
}
}
Expand All @@ -43,10 +42,10 @@ private bool CycleMultiplePinpointer(EntityUid uid, MultiplePinpointerComponent?
if (!Resolve(uid, ref multiple))
return false;

if (multiple.Modes.Count == 0)
if (multiple.Modes.Length == 0)
return false;

multiple.CurrentEntry = (uint)((multiple.CurrentEntry + 1) % multiple.Modes.Count);
multiple.CurrentEntry = (uint)((multiple.CurrentEntry + 1) % multiple.Modes.Length);
SetMultiplePinpointer(uid, multiple, user: user);

return true;
Expand All @@ -60,11 +59,11 @@ private void SetMultiplePinpointer(EntityUid uid,
if (!Resolve(uid, ref multiple, ref pin))
return;

if (multiple.Modes.Count <= multiple.CurrentEntry)
if (multiple.Modes.Length <= multiple.CurrentEntry)
return;

var current = multiple.Modes.ToArray()[multiple.CurrentEntry];
SetDistance(uid, Distance.Unknown);
var current = multiple.Modes[multiple.CurrentEntry];
SetDistance(uid, Distance.Unknown, pin);
if (current == "Off")
{
SetActive(uid, true, pin);
Expand Down
5 changes: 2 additions & 3 deletions Content.Shared/Pinpointer/MultiplePinpointerComponent.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;

namespace Content.Shared.Pinpointer;

[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class MultiplePinpointerComponent : Component
{
[DataField(required: true, customTypeSerializer: typeof(PrototypeIdHashSetSerializer<MultiplePinpointerPrototype>))]
public HashSet<string> Modes = new();
[DataField(required: true)]
public string[] Modes = Array.Empty<string>();

[ViewVariables, AutoNetworkedField]
public uint CurrentEntry = 0;
Expand Down
11 changes: 0 additions & 11 deletions Content.Shared/Pinpointer/MultiplePinpointerPrototype.cs

This file was deleted.

2 changes: 0 additions & 2 deletions Resources/Prototypes/Entities/Objects/Devices/pinpointer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@
- type: Icon
state: pinpointer-syndicate
- type: Pinpointer
component: NukeDisk
targetName: nuclear authentication disk
updateTargetName: true
- type: MultiplePinpointer
modes:
Expand Down

0 comments on commit 0ffca73

Please sign in to comment.