Skip to content

Commit

Permalink
bumped version to 1.3.1 and fixed bug where the chat message would sh…
Browse files Browse the repository at this point in the history
…ow if someone tried to defuse and there was an active grenade
  • Loading branch information
B3none committed Jan 9, 2024
1 parent 8298edf commit 961bd8c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
3 changes: 0 additions & 3 deletions CounterStrikeSharp/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions CounterStrikeSharp/README.md

This file was deleted.

20 changes: 10 additions & 10 deletions InstadefusePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace InstadefusePlugin;
[MinimumApiVersion(129)]
public class InstadefusePlugin : BasePlugin
{
private const string Version = "1.3.0";
private const string Version = "1.3.1";

public override string ModuleName => "Instadefuse Plugin";
public override string ModuleVersion => Version;
Expand Down Expand Up @@ -201,15 +201,6 @@ private void AttemptInstadefuse(CCSPlayerController player)
return;
}

PrintThreatLevel();

if (_heThreat > 0 || _molotovThreat > 0 || _infernoThreat.Any())
{
Console.WriteLine($"{LogPrefix}Instant Defuse not possible because a grenade threat is active!");
Server.PrintToChatAll($"{MessagePrefix}Instant Defuse not possible because a grenade threat is active!");
return;
}

var plantedBomb = FindPlantedBomb();
if (plantedBomb == null)
{
Expand All @@ -228,6 +219,15 @@ private void AttemptInstadefuse(CCSPlayerController player)
Console.WriteLine($"{LogPrefix}Terrorists are still alive");
return;
}

PrintThreatLevel();

if (_heThreat > 0 || _molotovThreat > 0 || _infernoThreat.Any())
{
Console.WriteLine($"{LogPrefix}Instant Defuse not possible because a grenade threat is active!");
Server.PrintToChatAll($"{MessagePrefix}Instant Defuse not possible because a grenade threat is active!");
return;
}

var bombTimeUntilDetonation = plantedBomb.TimerLength - (Server.CurrentTime - _bombPlantedTime);

Expand Down
11 changes: 5 additions & 6 deletions InstadefusePlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
</PropertyGroup>

<ItemGroup>
<Reference Include="CounterStrikeSharp.API">
<HintPath>.\CounterStrikeSharp\addons\counterstrikesharp\api\CounterStrikeSharp.API.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.142" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition=" '$(CopyPath)' != '' ">
<Exec Command="copy &quot;$(TargetPath)&quot; &quot;$(CopyPath)&quot; " />
</Target>
</Project>

0 comments on commit 961bd8c

Please sign in to comment.