legion icon indicating copy to clipboard operation
legion copied to clipboard

ComponentSource only support 128 components because ArchetypeWriter use u128 to store claimed.

Open lazytiger opened this issue 4 years ago • 2 comments

pub struct ArchetypeWriter<'a> {
    arch_index: ArchetypeIndex,
    archetype: &'a mut Archetype,
    components: MultiMut<'a>,
    claimed: u128,
    initial_count: usize,
}

ArchetypeWriter only counts at most 128 components, but this limit does not exist if using entry.add_component. Could clamied be extended to a slice or something else?

lazytiger avatar May 19 '21 07:05 lazytiger

The problem is components actually stored in storage, but the claimed counter is overflowed, so the assertion failed.

lazytiger avatar May 19 '21 07:05 lazytiger

Are you talking about u128 and usize?

selbyk avatar Mar 15 '22 20:03 selbyk