Skip to content

Commit 2657bfc

Browse files
Merge pull request #127 from dcl-regenesislabs/fix-rage-attack
fix: rage attack
2 parents 22bafa3 + b9328e6 commit 2657bfc

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
pointerEventsSystem,
44
PointerEvents,
55
InputAction,
6-
PointerEventType,
76
Transform,
87
MainCamera,
98
VirtualCamera,

src/server/lobbyServer.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,14 +1234,12 @@ export function setupLobbyServer(): void {
12341234
const zombie = zombieSpawnAtById.get(data.zombieId)
12351235
if (!zombie || zombie.spawnAtMs > now) return
12361236

1237-
const playerPosition = getPlayerPosition(normalizedAddress)
1238-
if (!playerPosition) return
1239-
if (distanceXZ(playerPosition.x, playerPosition.z, zombie.spawnX, zombie.spawnZ) > RAGE_SHIELD_RADIUS) return
1240-
12411237
const hitKey = getRageShieldHitKey(normalizedAddress, data.zombieId)
12421238
const lastHitAtMs = lastRageShieldHitAtMsByPlayerAndZombie.get(hitKey) ?? 0
12431239
if (now - lastHitAtMs < RAGE_SHIELD_HIT_COOLDOWN_MS) return
12441240

1241+
// The server only tracks the zombie spawn point, not its live world position.
1242+
// Range gating is already performed client-side against the current zombie transform.
12451243
lastRageShieldHitAtMsByPlayerAndZombie.set(hitKey, now)
12461244
applyZombieDamage(data.zombieId, RAGE_SHIELD_DAMAGE, normalizedAddress, now)
12471245
})

0 commit comments

Comments
 (0)