Skip to content

Commit

Permalink
Get the planted bomb again in the Server.NextFrame call
Browse files Browse the repository at this point in the history
  • Loading branch information
B3none authored Apr 5, 2024
1 parent f2c0046 commit 299d080
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion InstadefusePlugin.cs
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ namespace InstadefusePlugin;
[MinimumApiVersion(147)]
public class InstadefusePlugin : BasePlugin
{
private const string Version = "1.4.2";
private const string Version = "1.4.3";

public override string ModuleName => "Instadefuse Plugin";
public override string ModuleVersion => Version;
@@ -279,6 +279,9 @@ private void AttemptInstadefuse(CCSPlayerController defuser)

Server.NextFrame(() =>
{
// We get the planted bomb again as it was sometimes crashing.
var plantedBomb = FindPlantedBomb();

plantedBomb.C4Blow = 1.0f;

Check warning on line 285 in InstadefusePlugin.cs

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 285 in InstadefusePlugin.cs

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 285 in InstadefusePlugin.cs

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 285 in InstadefusePlugin.cs

GitHub Actions / build

Dereference of a possibly null reference.
});

@@ -287,6 +290,9 @@ private void AttemptInstadefuse(CCSPlayerController defuser)

Server.NextFrame(() =>
{
// We get the planted bomb again as it was sometimes crashing.
var plantedBomb = FindPlantedBomb();

plantedBomb.DefuseCountDown = 0;

Check warning on line 296 in InstadefusePlugin.cs

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 296 in InstadefusePlugin.cs

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 296 in InstadefusePlugin.cs

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 296 in InstadefusePlugin.cs

GitHub Actions / build

Dereference of a possibly null reference.

Server.PrintToChatAll(MessagePrefix + _translator["instadefuse.successful", defuser.PlayerName, $"{Math.Abs(bombTimeUntilDetonation):n3}"]);

0 comments on commit 299d080

Please sign in to comment.