Skip to content

Commit

Permalink
fixing up implosion grenades
Browse files Browse the repository at this point in the history
  • Loading branch information
joker-119 committed Feb 24, 2022
1 parent f7a5a63 commit b5183e6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CustomItems/Items/ImplosionGrenade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ protected override void OnExploding(ExplodingGrenadeEventArgs ev)

bool line = Physics.Linecast(ev.Grenade.transform.position, player.Position, layerMask);
Log.Debug($"{player.Nickname} - {line}", CustomItems.Instance.Config.IsDebugEnabled);
if (!line)
if (line)
{
effectedPlayers.Add(player);
Coroutines.Add(Timing.RunCoroutine(DoSuction(player, ev.Grenade.transform.position + (Vector3.up * 1.5f))));
Expand Down
16 changes: 1 addition & 15 deletions CustomItems/Items/LuckyCoin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace CustomItems.Items
/// <inheritdoc />
public class LuckyCoin : CustomItem
{
private readonly List<PocketDimensionTeleport> teleports = new List<PocketDimensionTeleport>();
private bool isDropped;
private bool onCooldown;

Expand Down Expand Up @@ -68,15 +67,13 @@ public class LuckyCoin : CustomItem
/// <inheritdoc/>
protected override void SubscribeEvents()
{
Server.RoundStarted += OnRoundStart;
Player.EnteringPocketDimension += OnEnterPocketDimension;
base.SubscribeEvents();
}

/// <inheritdoc/>
protected override void UnsubscribeEvents()
{
Server.RoundStarted -= OnRoundStart;
Player.EnteringPocketDimension -= OnEnterPocketDimension;
base.UnsubscribeEvents();
}
Expand Down Expand Up @@ -109,17 +106,6 @@ protected override void OnDropping(DroppingItemEventArgs ev)
}
}

private void OnRoundStart()
{
teleports.Clear();

foreach (PocketDimensionTeleport teleport in Object.FindObjectsOfType<PocketDimensionTeleport>())
{
teleports.Add(teleport);
Log.Debug("Adding PD Teleport..", CustomItems.Instance.Config.IsDebugEnabled);
}
}

private void OnEnterPocketDimension(EnteringPocketDimensionEventArgs ev)
{
Log.Debug($"{ev.Player.Nickname} Entering Pocket Dimension.", CustomItems.Instance.Config.IsDebugEnabled);
Expand All @@ -133,7 +119,7 @@ private void OnEnterPocketDimension(EnteringPocketDimensionEventArgs ev)
return;

Log.Debug($"{ev.Player.Nickname} - EPD checks passed.", CustomItems.Instance.Config.IsDebugEnabled);
foreach (PocketDimensionTeleport teleport in teleports)
foreach (PocketDimensionTeleport teleport in Map.PocketDimensionTeleports)
{
Log.Debug($"{ev.Player.Nickname} - Checking teleporter..", CustomItems.Instance.Config.IsDebugEnabled);
if (teleport._type != PocketDimensionTeleport.PDTeleportType.Exit)
Expand Down
4 changes: 2 additions & 2 deletions CustomItems/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("6.0.0.0")]
[assembly: AssemblyFileVersion("6.0.0.0")]
[assembly: AssemblyVersion("6.0.1.0")]
[assembly: AssemblyFileVersion("6.0.1.0")]

0 comments on commit b5183e6

Please sign in to comment.