From 5b88642becd21471cbdaf12a4d3f1c4b59890745 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Mon, 22 Apr 2024 23:13:09 +0200 Subject: [PATCH] fix is map at tile check --- tanks-backend/TanksServer/GameLogic/MapService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tanks-backend/TanksServer/GameLogic/MapService.cs b/tanks-backend/TanksServer/GameLogic/MapService.cs index 82b0344..7910cdc 100644 --- a/tanks-backend/TanksServer/GameLogic/MapService.cs +++ b/tanks-backend/TanksServer/GameLogic/MapService.cs @@ -94,8 +94,8 @@ internal sealed class Map(string name, bool[,] walls) { var pixel = position.ToPixelPosition(); - for (short dx = 1; dx < MapService.TilesPerRow - 1; dx++) - for (short dy = 1; dy < MapService.TilesPerColumn - 1; dy++) + for (short dx = 0; dx < MapService.TileSize; dx++) + for (short dy = 0; dy < MapService.TileSize; dy++) { if (IsWall(pixel.GetPixelRelative(dx, dy))) return true;