diff --git a/src/map.rs b/src/map.rs index a2085af..9513daf 100644 --- a/src/map.rs +++ b/src/map.rs @@ -313,7 +313,7 @@ fn collect_spacial_blocks( model_count+=1; models.push(model); }); - let id=BlockId::new(block_headers.len() as u32); + let id=BlockId::new(block_headers.len() as u32+1); block_headers.push(SpacialBlockHeader{ id, extents, @@ -362,7 +362,7 @@ pub fn write_map(mut writer:W,map:strafesnet_common::map::Comple let mut sequential_block_data=Vec::new(); let mut cursor_to_data=std::io::Cursor::new(&mut sequential_block_data); collect_spacial_blocks(&mut block_location,&mut spacial_blocks,&mut cursor_to_data,bvh)?; - let mut block_count=spacial_blocks.len() as u32;//continue block id + let mut block_count=spacial_blocks.len() as u32+1;//continue block id let mut resource_blocks=Vec::new();//for map header //meshes for mesh in map.meshes.into_iter(){ @@ -400,9 +400,6 @@ pub fn write_map(mut writer:W,map:strafesnet_common::map::Comple attributes:map.attributes.into_iter().map(Into::into).collect(), render_configs:map.render_configs.into_iter().map(Into::into).collect(), }; - //the map header is a block! - block_count+=1; - assert_eq!(block_count as usize+1,block_location.len()); let mut file_header=crate::file::Header{ fourcc:crate::file::FourCC::Map, version:0,