@@ -687,21 +687,23 @@ impl PropertyTagDataPartial {
687687 Self :: Other ( t) => PropertyTagDataFull :: Other ( t) ,
688688 }
689689 }
690- }
691-
692- impl PropertyTagDataFull {
693- fn basic_type ( & self ) -> PropertyType {
690+ pub ( crate ) fn has_raw_struct ( & self ) -> bool {
694691 match self {
695- Self :: Array ( _) => PropertyType :: ArrayProperty ,
696- Self :: Struct { .. } => PropertyType :: StructProperty ,
697- Self :: Set { .. } => PropertyType :: SetProperty ,
698- Self :: Map { .. } => PropertyType :: MapProperty ,
699- Self :: Byte ( _) => PropertyType :: ByteProperty ,
700- Self :: Enum ( _, _) => PropertyType :: EnumProperty ,
701- Self :: Bool ( _) => PropertyType :: BoolProperty ,
702- Self :: Other ( property_type) => * property_type,
692+ Self :: Array ( inner) => inner. has_raw_struct ( ) ,
693+ Self :: Struct { struct_type, .. } => struct_type. raw ( ) ,
694+ Self :: Set { key_type } => key_type. has_raw_struct ( ) ,
695+ Self :: Map {
696+ key_type,
697+ value_type,
698+ } => key_type. has_raw_struct ( ) || value_type. has_raw_struct ( ) ,
699+ Self :: Byte ( _) => false ,
700+ Self :: Enum ( _, _) => false ,
701+ Self :: Other ( _) => false ,
703702 }
704703 }
704+ }
705+
706+ impl PropertyTagDataFull {
705707 fn has_raw_struct ( & self ) -> bool {
706708 match self {
707709 Self :: Array ( inner) => inner. has_raw_struct ( ) ,
@@ -717,6 +719,18 @@ impl PropertyTagDataFull {
717719 Self :: Other ( _) => false ,
718720 }
719721 }
722+ fn basic_type ( & self ) -> PropertyType {
723+ match self {
724+ Self :: Array ( _) => PropertyType :: ArrayProperty ,
725+ Self :: Struct { .. } => PropertyType :: StructProperty ,
726+ Self :: Set { .. } => PropertyType :: SetProperty ,
727+ Self :: Map { .. } => PropertyType :: MapProperty ,
728+ Self :: Byte ( _) => PropertyType :: ByteProperty ,
729+ Self :: Enum ( _, _) => PropertyType :: EnumProperty ,
730+ Self :: Bool ( _) => PropertyType :: BoolProperty ,
731+ Self :: Other ( property_type) => * property_type,
732+ }
733+ }
720734 fn from_type ( inner_type : PropertyType , struct_type : Option < StructType > ) -> Self {
721735 match inner_type {
722736 PropertyType :: BoolProperty => Self :: Bool ( false ) ,
@@ -4467,6 +4481,13 @@ impl<T: ArchiveType> Property<T> {
44674481 tag : PropertyTagFull ,
44684482 ) -> Result < ( Property < T > , Option < PropertyTagDataFull > ) > {
44694483 if tag. data . has_raw_struct ( ) {
4484+ if ar. log ( ) {
4485+ eprintln ! (
4486+ "Warning: Storing property '{}' as raw bytes; tag contains native-serialized struct with no parser: {:?}" ,
4487+ ar. path( ) ,
4488+ tag. data,
4489+ ) ;
4490+ }
44704491 let mut raw = vec ! [ 0 ; tag. size as usize ] ;
44714492 ar. read_exact ( & mut raw) ?;
44724493 return Ok ( ( Property :: Raw ( raw) , None ) ) ;
0 commit comments