From 7ecff06ae8d5f6533a2fbff370a9e5e7a6390cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Wed, 3 Nov 2021 18:21:10 +0100 Subject: [PATCH] limit block count at compile time --- code/game/src/world/blocks_list.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/game/src/world/blocks_list.c b/code/game/src/world/blocks_list.c index 369f082..fec9627 100644 --- a/code/game/src/world/blocks_list.c +++ b/code/game/src/world/blocks_list.c @@ -23,3 +23,5 @@ static block blocks[] = { BLOCK(ASSET_BELT_UP, 0, '@', .drag = 1.0f , .friction = 1.0f, .vely = -150.0f), BLOCK(ASSET_BELT_DOWN, 0, '@', .drag = 1.0f , .friction = 1.0f, .vely = 150.0f), }; + +ZPL_STATIC_ASSERT(sizeof(blocks)/sizeof(blocks[0]) < 256, "too many registered blocks! (max. 256)"); \ No newline at end of file