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]) }) } 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) { 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)