zoom to mouse even when using q/e

This commit is contained in:
Zutatensuppe 2021-05-31 23:06:19 +02:00
parent 870f827e49
commit 69a949381f
3 changed files with 54 additions and 16 deletions

View file

@ -625,6 +625,16 @@ function handleInput(
const name = `${input[1]}`.substr(0, 16)
changePlayer(gameId, playerId, { name, ts })
_playerChange()
} else if (type === Protocol.INPUT_EV_MOVE) {
const w = input[1]
const h = input[2]
const player = getPlayer(gameId, playerId)
if (player) {
const x = player.x - w
const y = player.y - h
changePlayer(gameId, playerId, { ts, x, y })
_playerChange()
}
} else if (type === Protocol.INPUT_EV_MOUSE_DOWN) {
const x = input[1]
const y = input[2]