@@ -6,7 +6,8 @@ use std::ops::Deref;
66use std:: slice:: Iter ;
77
88use binrw:: { BinRead , BinReaderExt , BinResult , Endian , VecArgs } ;
9- use log:: error;
9+ use log:: { error, warn} ;
10+ use quicktag_core:: util:: FNV1_BASE ;
1011use rustc_hash:: { FxHashMap , FxHashSet } ;
1112use tiger_pkg:: { DestinyVersion , GameVersion , MarathonVersion , TagHash , package_manager} ;
1213
@@ -476,6 +477,13 @@ pub fn create_stringmap_d2() -> anyhow::Result<StringCache> {
476477 }
477478 }
478479
480+ if * hash == FNV1_BASE {
481+ if !final_string. is_empty ( ) {
482+ warn ! ( "String '{final_string}' has an empty hash (0x{FNV1_BASE:X})" ) ;
483+ }
484+ continue ;
485+ }
486+
479487 tmp_map. entry ( * hash) . or_default ( ) . insert ( final_string) ;
480488 }
481489 }
@@ -529,6 +537,13 @@ pub fn create_stringmap_d1() -> anyhow::Result<StringCache> {
529537 final_string += & decode_text ( & data, part. cipher_shift ) ;
530538 }
531539
540+ if * hash == FNV1_BASE {
541+ if !final_string. is_empty ( ) {
542+ warn ! ( "String '{final_string}' has an empty hash (0x{FNV1_BASE:X})" ) ;
543+ }
544+ continue ;
545+ }
546+
532547 tmp_map. entry ( * hash) . or_default ( ) . insert ( final_string) ;
533548 }
534549 }
@@ -588,6 +603,13 @@ pub fn create_stringmap_d1_devalpha() -> anyhow::Result<StringCache> {
588603 final_string += & String :: from_utf16_lossy ( & data) ;
589604 }
590605
606+ if * hash == FNV1_BASE {
607+ if !final_string. is_empty ( ) {
608+ warn ! ( "String '{final_string}' has an empty hash (0x{FNV1_BASE:X})" ) ;
609+ }
610+ continue ;
611+ }
612+
591613 tmp_map. entry ( * hash) . or_default ( ) . insert ( final_string) ;
592614 }
593615 }
@@ -650,6 +672,13 @@ pub fn create_stringmap_d1_firstlook() -> anyhow::Result<StringCache> {
650672 final_string += & String :: from_utf16 ( & data_u16) ?;
651673 }
652674
675+ if * hash == FNV1_BASE {
676+ if !final_string. is_empty ( ) {
677+ warn ! ( "String '{final_string}' has an empty hash (0x{FNV1_BASE:X})" ) ;
678+ }
679+ continue ;
680+ }
681+
653682 tmp_map. entry ( * hash) . or_default ( ) . insert ( final_string) ;
654683 }
655684 }
0 commit comments