player can shoot bullet (crashes game when leaving map)

This commit is contained in:
Vinzenz Schroeter 2024-04-07 19:05:50 +02:00
commit b10ccf2da8

View file

@ -0,0 +1,13 @@
using TanksServer.Helpers;
using TanksServer.Services;
namespace TanksServer.DrawSteps;
internal sealed class BulletDrawer(BulletManager bullets): IDrawStep
{
public void Draw(DisplayPixelBuffer buffer)
{
foreach (var bullet in bullets.GetAll())
buffer.Pixels[bullet.Position.ToPixelPosition().GetPixelIndex()] = true;
}
}