Skip to content

Commit

Permalink
fix: Exiled.API.Features.Scp914.Scp914InputObject return nothing & Ex…
Browse files Browse the repository at this point in the history
…ception in OnWaitingForPlayers (#367)

* Fix return nothing

* Fix argument exception
  • Loading branch information
scp252arc authored Jan 4, 2025
1 parent efd46ef commit 7377b5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions EXILED/Exiled.API/Features/Scp914.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static Scp914Mode ConfigMode
/// <summary>
/// Gets a value indicating all of the GameObjects currently present inside SCP-914's intake chamber.
/// </summary>
public static Collider[] InsideIntake => Physics.OverlapBox(IntakePosition, Scp914Controller.IntakeChamberSize);
public static Collider[] InsideIntake => Physics.OverlapBox(Scp914Controller.IntakeChamber.position, Scp914Controller.IntakeChamberSize);

/// <summary>
/// Gets the intake booth <see cref="UnityEngine.Transform"/>.
Expand Down Expand Up @@ -116,8 +116,7 @@ public static IEnumerable<GameObject> Scp914InputObject(out IEnumerable<Player>
{
pickups.Add(pickup);
}
else if (Player.TryGet(gameObject, out Player player)
&& Physics.Linecast(player.Position, IntakePosition, Scp914Upgrader.SolidObjectMask))
else if (Player.TryGet(gameObject, out Player player))
{
players.Add(player);
}
Expand Down
6 changes: 3 additions & 3 deletions EXILED/Exiled.Events/Handlers/Internal/Round.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private static void GenerateAttachments()
if (Item.Create(firearmType.GetItemType()) is not Firearm firearm)
continue;

Firearm.ItemTypeToFirearmInstance.Add(firearmType, firearm);
Firearm.ItemTypeToFirearmInstance[firearmType] = firearm;

List<AttachmentIdentifier> attachmentIdentifiers = ListPool<AttachmentIdentifier>.Pool.Get();
HashSet<AttachmentSlot> attachmentsSlots = HashSetPool<AttachmentSlot>.Pool.Get();
Expand All @@ -136,8 +136,8 @@ private static void GenerateAttachments()
.Where(attachment => attachment.Slot == slot)
.Min(slot => slot.Code));

Firearm.BaseCodesValue.Add(firearmType, baseCode);
Firearm.AvailableAttachmentsValue.Add(firearmType, attachmentIdentifiers.ToArray());
Firearm.BaseCodesValue[firearmType] = baseCode;
Firearm.AvailableAttachmentsValue[firearmType] = attachmentIdentifiers.ToArray();

ListPool<AttachmentIdentifier>.Pool.Return(attachmentIdentifiers);
HashSetPool<AttachmentSlot>.Pool.Return(attachmentsSlots);
Expand Down

0 comments on commit 7377b5e

Please sign in to comment.