Skip to content

Commit

Permalink
fixed bomb explode event
Browse files Browse the repository at this point in the history
  • Loading branch information
osztenkurden committed May 29, 2024
1 parent 138bb6a commit d88e786
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 2 additions & 0 deletions lib/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "csgogsi",
"version": "3.0.4",
"version": "3.0.5",
"description": "",
"main": "lib/index.js",
"module": "lib/index.mjs",
Expand Down
2 changes: 2 additions & 0 deletions tsc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d88e786

Please sign in to comment.