diff --git a/src/reskit/level/system.rs b/src/reskit/level/system.rs index 28acfa5..70e91bb 100644 --- a/src/reskit/level/system.rs +++ b/src/reskit/level/system.rs @@ -379,6 +379,14 @@ pub fn get_ecs( tilemap: &TiledTilemap ) -> Result, Box> { } } + // Fill the remainder of the sparse array with 0xFF, if needed + let remainder = 512 - tilemap.ecs.len(); + for _ in 0..remainder { + for _ in 0..largest_type_attributes_size { + result.extend( ( 0xFFFF as u16 ).to_be_bytes() ); + } + } + // Output IDs to terminal let component_ids: Vec = component_ids.into_iter().collect(); for i in 0..component_ids.len() {