Skip to content

Commit

Permalink
fixed crash
Browse files Browse the repository at this point in the history
  • Loading branch information
JustMarfix committed Jul 29, 2024
1 parent f7ae5d5 commit f311312
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions Commands/ShakhedBoom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
return false;
}
playerSender.Explode(ProjectileType.FragGrenade, playerSender);
VeryUsualDay.Instance.Shakheds.Remove(playerSender.Id);
response = "Бабах.";
return true;
}
Expand Down
8 changes: 5 additions & 3 deletions Handlers/Player.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Runtime.CompilerServices;
using System.Linq;
using System.Runtime.CompilerServices;
using Exiled.API.Enums;
using Exiled.API.Extensions;
using Exiled.API.Features;
Expand Down Expand Up @@ -226,9 +227,10 @@ public static void OnVerified(VerifiedEventArgs ev)

public static void OnHurt(HurtEventArgs ev)
{
if (VeryUsualDay.Instance.Config.BlowingDamageTypes.Contains(ev.DamageHandler.Type))
if (VeryUsualDay.Instance.Shakheds.Contains(ev.Player.Id) && VeryUsualDay.Instance.Config.BlowingDamageTypes.Contains(ev.DamageHandler.Type))
{
ev.Player.Explode(ProjectileType.FragGrenade, ev.Attacker);
VeryUsualDay.Instance.Shakheds.Remove(ev.Player.Id);
ev.Player.Explode(ProjectileType.FragGrenade);
}
if (!VeryUsualDay.Instance.IsEnabledInRound ||
!ev.Player.TryGetSessionVariable("vudmood", out string mood)) return;
Expand Down

0 comments on commit f311312

Please sign in to comment.