From b12606899c98d7fc7a120c2b79797b5c45283ad2 Mon Sep 17 00:00:00 2001 From: zlago Date: Wed, 23 Oct 2024 19:17:26 +0200 Subject: hacky save system --- src/tilemap.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/tilemap.c') diff --git a/src/tilemap.c b/src/tilemap.c index e7ee1d4..34e7c43 100644 --- a/src/tilemap.c +++ b/src/tilemap.c @@ -102,6 +102,9 @@ void tilemap_foreground(struct tilemap *tilemap, int x, int y, int w, int h) { } void tilemap_free(struct tilemap *tilemap) { + if (tilemap == NULL) { + return; + } SDL_DestroyTexture(tilemap->tileset); SDL_DestroyTexture(tilemap->wang_tileset); free(tilemap->parallax); -- cgit 1.4.1-2-gfad0