Skip to content

Commit

Permalink
Fix container crash when first entity ID isn't in first bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusikkala committed Jul 26, 2023
1 parent 7306bc7 commit c5faef5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions monkeroecs.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,7 @@ void component_container<T>::jump_table_insert(entity id)
entity prev_start_id = find_previous_entity(id);
std::uint32_t prev_start_hi = prev_start_id >> bucket_exp;
std::uint32_t prev_start_lo = prev_start_id & bucket_mask;
ensure_jump_table(prev_start_hi);
entity& prev_start = bucket_jump_table[prev_start_hi][prev_start_lo];

if(prev_start_id + 1 < id)
Expand Down
1 change: 1 addition & 0 deletions multi/container.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ void component_container<T>::jump_table_insert(entity id)
entity prev_start_id = find_previous_entity(id);
std::uint32_t prev_start_hi = prev_start_id >> bucket_exp;
std::uint32_t prev_start_lo = prev_start_id & bucket_mask;
ensure_jump_table(prev_start_hi);
entity& prev_start = bucket_jump_table[prev_start_hi][prev_start_lo];

if(prev_start_id + 1 < id)
Expand Down

0 comments on commit c5faef5

Please sign in to comment.