From d88e786462375bd7cbf5063584c4cc149b6aed0e Mon Sep 17 00:00:00 2001 From: Hubert Walczak Date: Wed, 29 May 2024 09:56:28 +0200 Subject: [PATCH] fixed bomb explode event --- lib/index.js | 2 ++ lib/index.mjs | 2 ++ package.json | 2 +- tsc/index.ts | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 084f673..e152b4d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -426,6 +426,8 @@ var CSGOGSI = class _CSGOGSI { } else if (last.bomb.state !== "planting" && data.bomb.state === "planting") { this.emit("bombPlantStart", last.bomb.player); } + } else if (!last.bomb && data.bomb && data.bomb.state === "exploded") { + this.emit("bombExplode"); } if (data.map.phase === "intermission" && last.map.phase !== "intermission") { this.emit("intermissionStart"); diff --git a/lib/index.mjs b/lib/index.mjs index 9efb80b..0aa3d9e 100644 --- a/lib/index.mjs +++ b/lib/index.mjs @@ -396,6 +396,8 @@ var CSGOGSI = class _CSGOGSI { } else if (last.bomb.state !== "planting" && data.bomb.state === "planting") { this.emit("bombPlantStart", last.bomb.player); } + } else if (!last.bomb && data.bomb && data.bomb.state === "exploded") { + this.emit("bombExplode"); } if (data.map.phase === "intermission" && last.map.phase !== "intermission") { this.emit("intermissionStart"); diff --git a/package.json b/package.json index 9148597..90b4a91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "csgogsi", - "version": "3.0.4", + "version": "3.0.5", "description": "", "main": "lib/index.js", "module": "lib/index.mjs", diff --git a/tsc/index.ts b/tsc/index.ts index 0f9c443..4bd95bb 100644 --- a/tsc/index.ts +++ b/tsc/index.ts @@ -398,6 +398,8 @@ class CSGOGSI { } else if (last.bomb.state !== 'planting' && data.bomb.state === 'planting') { this.emit('bombPlantStart', last.bomb.player); } + } else if (!last.bomb && data.bomb && data.bomb.state === 'exploded') { + this.emit('bombExplode'); } // Intermission (between halfs)