Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace Exiled.Events.Patches.Events.Map
{
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;

using API.Features;
Expand Down Expand Up @@ -64,7 +65,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
private static void ProcessEvent(FlashbangGrenade instance, float distance)
{
HashSet<Player> targetToAffect = HashSetPool<Player>.Pool.Get();
foreach (Player player in Player.List)
foreach (Player player in ReferenceHub.AllHubs.Select(Player.Get))
{
if ((instance.transform.position - player.Position).sqrMagnitude >= distance)
continue;
Expand All @@ -88,9 +89,7 @@ private static void ProcessEvent(FlashbangGrenade instance, float distance)
return;

foreach (Player player in explodingGrenadeEvent.TargetsToAffect)
{
instance.ProcessPlayer(player.ReferenceHub);
}
}
}
}