CRAB: Fix bug where start.x could be less than 0

This commit is contained in:
hax0kartik authored and Eugene Sandulenko committed 2023-08-10 17:06:59 +02:00
1 parent 883e467c2d
commit f2cc4568f4
1 file changed
+3
+3
View File
@@ -155,6 +155,9 @@ void TileSetGroup::ForceDraw(MapLayer &layer, const Rect &camera, const Vector2i
start.x = player_pos.y / tile_size.y;
start.y = player_pos.x / tile_size.x;
if(start.x < 0 || start.y < 0)
return;
// The row and column we end drawing at
finish.x = (player_pos.y + player_pos.h) / tile_size.y + 1;
finish.y = (player_pos.x + player_pos.w) / tile_size.x + 1;