Skip to content

Commit

Permalink
#837 add assert when using bulk_init on readonly world
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Oct 13, 2022
1 parent e8025ba commit c763687
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion flecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -7167,7 +7167,8 @@ const ecs_entity_t* ecs_bulk_init(
ecs_world_t *world,
const ecs_bulk_desc_t *desc)
{
ecs_check(world != NULL, ECS_INVALID_PARAMETER, NULL);
ecs_poly_assert(world, ecs_world_t);
ecs_assert(!(world->flags & EcsWorldReadonly), ECS_INTERNAL_ERROR, NULL);
ecs_check(desc != NULL, ECS_INVALID_PARAMETER, NULL);
ecs_check(desc->_canary == 0, ECS_INVALID_PARAMETER, NULL);

Expand Down
3 changes: 2 additions & 1 deletion src/entity.c
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,8 @@ const ecs_entity_t* ecs_bulk_init(
ecs_world_t *world,
const ecs_bulk_desc_t *desc)
{
ecs_check(world != NULL, ECS_INVALID_PARAMETER, NULL);
ecs_poly_assert(world, ecs_world_t);
ecs_assert(!(world->flags & EcsWorldReadonly), ECS_INTERNAL_ERROR, NULL);
ecs_check(desc != NULL, ECS_INVALID_PARAMETER, NULL);
ecs_check(desc->_canary == 0, ECS_INVALID_PARAMETER, NULL);

Expand Down

0 comments on commit c763687

Please sign in to comment.