From 838792fca41b9bccce260e9500d75549433bbe6a Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 18 May 2025 11:10:09 -0700 Subject: Add bounds check to set_sand() Previously, painting didn't do it (simulation did) so there were buffer overruns --- src/sandbox.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/sandbox.hpp') diff --git a/src/sandbox.hpp b/src/sandbox.hpp index 400f8ec..0ae8082 100644 --- a/src/sandbox.hpp +++ b/src/sandbox.hpp @@ -47,9 +47,13 @@ struct Sandbox { void simulate_step(); + // "Get Sand" Tile& gs(int x, int y); - void set_sand(int x, int y, Tile sand); + // "Set Sand" + void ss(int x, int y, Tile sand); void shift_sand(int x, int y); + void mark_dirty(int x, int y); // UNCHECKED + // std::vector to_bitmap() const; }; -- cgit v1.2.3-70-g09d2