From 99c58ff2eb4d47b7be4fbe6640eba77ac628437d Mon Sep 17 00:00:00 2001 From: Moyomo Date: Fri, 28 Jun 2024 14:35:27 +0200 Subject: [PATCH 1/3] Fixed smoke gap position calculation --- src/renderers/smokes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderers/smokes.js b/src/renderers/smokes.js index b76fe65..4f6435a 100644 --- a/src/renderers/smokes.js +++ b/src/renderers/smokes.js @@ -98,8 +98,8 @@ socket.element.addEventListener("explosion", event => { gapElement.id = "gap" + event.data.id // Calculate gap position within smoke - gapElement.style.left = (smokeX - pos.x) / smokeSize * 100 + "%" - gapElement.style.bottom = (smokeY - pos.y) / smokeSize * 100 + "%" + gapElement.style.left = (pos.x - smokeX) / smokeSize * 100 + "%" + gapElement.style.bottom = (pos.y - smokeY) / smokeSize * 100 + "%" // Insert gap into smoke smokeElement.appendChild(gapElement) From b84ba001a6cd1164947244968dbff22c38d0324e Mon Sep 17 00:00:00 2001 From: Moyomo Date: Fri, 28 Jun 2024 14:41:47 +0200 Subject: [PATCH 2/3] Fixed HE grenades not being drawn The second and third trail part have the same position, causing the projectile opacity to get set to 0 right after throwing --- src/renderers/projectiles.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderers/projectiles.js b/src/renderers/projectiles.js index a38ddad..2aa4983 100644 --- a/src/renderers/projectiles.js +++ b/src/renderers/projectiles.js @@ -58,8 +58,8 @@ socket.element.addEventListener("projectiles", event => { if (projectile.type == 'frag') { // Get the previous coords from the let trailParts = trailElement.getAttributeNS(null, "d").split(" ") - // True if more than two packets are known and nade stationary - let isStationary = trailParts.length > 6 + // True if more than three packets are known and nade stationary + let isStationary = trailParts.length > 9 // Go through each nade position from last to newest, max last 5 for (let i = trailParts.length - 1; i > 2 && trailParts.length - i < 5 * 3; i -= 3) { From 8ccc17904b0cc7b0063fbc9242840c4364e5dea8 Mon Sep 17 00:00:00 2001 From: Moyomo Date: Fri, 28 Jun 2024 14:46:42 +0200 Subject: [PATCH 3/3] Removed old bugfix for wrong molotov fire coordinates Apparently this got fixed in a game update and the flame coordinates are not doubled anymore --- src/gsi.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gsi.js b/src/gsi.js index d5e2aef..7278de8 100644 --- a/src/gsi.js +++ b/src/gsi.js @@ -177,10 +177,9 @@ function handleRequest(req, res) { for (var i = 0; i < flamesNum; i++) { let pos = Object.values(nade.flames)[i].split(", ") flamesPos.push({ - // BUG: CS2 has the coords doubled for some reason - x: parseFloat(pos[0]) / 2, - y: parseFloat(pos[1]) / 2, - z: parseFloat(pos[2]) / 2 + x: parseFloat(pos[0]), + y: parseFloat(pos[1]), + z: parseFloat(pos[2]) }) }