diff --git a/dod.c b/dod.c index 3d62f98..362c14b 100644 --- a/dod.c +++ b/dod.c @@ -21,7 +21,7 @@ enum EntityTag { typedef struct Entity Entity; struct Entity { - u16 id; + u32 id; }; typedef struct Position Position; @@ -137,7 +137,7 @@ void init_manager(const Allocator *allocator, Manager *manager) { assert(allocator != NULL && manager != NULL); u64 total_count = (u64)WANDERER_COUNT + (u64)ZONE_COUNT; - total_count += 4 - (total_count % 4); + assert(total_count < (1lu << 32)); // Ensure we're not exceeding the maximum limit of entities u64 entities_size = sizeof(Entity) * total_count; u64 rects_size = sizeof(Rect) * total_count;