diff --git a/src/Core/Ramp.php b/src/Core/Ramp.php index 9f9abd8..f1be0a9 100644 --- a/src/Core/Ramp.php +++ b/src/Core/Ramp.php @@ -39,7 +39,7 @@ public function __construct( // todo use only walls and floors for fewer walls and floors or use box $sides param $this->boxes[] = new Box($point->clone(), $width, $heightSum, $depth); - $heightSum = $stairsGrowingUp ? $heightSum + $stepHeight : $heightSum - $stepHeight; + $heightSum = $stairsGrowingUp ? $heightSum + $stepHeight : $heightSum - $stepHeight; // TODO fix going down if ($direction->x <> 0) { $point->addX(($direction->x > 0 ? 1 : -1) * $stepDepth); } else { diff --git a/test/simulation/data/requests/002.php b/test/simulation/data/requests/002.php index 9067b22..453d95f 100644 --- a/test/simulation/data/requests/002.php +++ b/test/simulation/data/requests/002.php @@ -10,6 +10,9 @@ public function onTickEnd(GameState $state, int $tick): void { $pp = $state->getPlayer(1)->getPositionImmutable(); + if ($pp->z > 2435) { + $this->fail("Outside map, tick: $tick"); + } if ($pp->y === 0 && $pp->z === 2435) { if ($pp->x === 1169) { $this->fail("Inside Box, tick: $tick"); diff --git a/www/assets/js/Game.js b/www/assets/js/Game.js index 64378f8..326127d 100644 --- a/www/assets/js/Game.js +++ b/www/assets/js/Game.js @@ -28,6 +28,13 @@ export class Game { } pause(msg, timeMs) { + const game = this + this.players.forEach(function (player) { + if (player.data.id === game.playerMe.id) { + return + } + player.object.visible = true + }) this.#started = true this.#paused = true console.log("Pause: " + msg + " for " + timeMs + "ms") @@ -98,6 +105,7 @@ export class Game { } playerKilled(playerIdDead, playerIdCulprit, wasHeadshot, killItemId) { + this.players[playerIdDead].object.visible = false this.#hud.showKill( this.players[playerIdCulprit].data, this.players[playerIdDead].data,