diff --git a/src/references.rs b/src/references.rs index 093d74f..6b7bcc5 100644 --- a/src/references.rs +++ b/src/references.rs @@ -109,14 +109,9 @@ pub fn initialize_reference_names() { destiny_pkg::PackageVersion::Destiny2Shadowkeep => REFERENCE_MAP_SK.clone(), destiny_pkg::PackageVersion::Destiny2BeyondLight | destiny_pkg::PackageVersion::Destiny2WitchQueen - | destiny_pkg::PackageVersion::Destiny2Lightfall => REFERENCE_MAP_BL.clone(), - _ => { - warn!( - "No reference table found for {:?}", - package_manager().version - ); - Default::default() - } + | destiny_pkg::PackageVersion::Destiny2Lightfall + | destiny_pkg::PackageVersion::Destiny2TheFinalShape => REFERENCE_MAP_BL.clone(), + u => panic!("Unsupported game version {u:?} (initialize_reference_names)"), }; references.extend(version_specific); diff --git a/src/tagtypes.rs b/src/tagtypes.rs index 4b3a731..cf7ba7b 100644 --- a/src/tagtypes.rs +++ b/src/tagtypes.rs @@ -154,6 +154,7 @@ impl Display for TagType { impl TagType { pub fn from_type_subtype(t: u8, st: u8) -> TagType { + // TODO: Change this match to use ordered version checking after destiny-pkg 0.11 match package_manager().version { PackageVersion::DestinyInternalAlpha => Self::from_type_subtype_devalpha(t, st), PackageVersion::DestinyTheTakenKing => Self::from_type_subtype_ttk(t, st), @@ -161,11 +162,9 @@ impl TagType { PackageVersion::Destiny2Shadowkeep => Self::from_type_subtype_sk(t, st), PackageVersion::Destiny2BeyondLight | PackageVersion::Destiny2WitchQueen - | PackageVersion::Destiny2Lightfall => Self::from_type_subtype_lf(t, st), - _ => TagType::Unknown { - ftype: t, - fsubtype: st, - }, + | PackageVersion::Destiny2Lightfall + | PackageVersion::Destiny2TheFinalShape => Self::from_type_subtype_lf(t, st), + u => panic!("Unsupported game version {u:?} (TagType::from_type_subtype)"), } } diff --git a/src/text.rs b/src/text.rs index 1dbc889..ab9f1ae 100644 --- a/src/text.rs +++ b/src/text.rs @@ -364,26 +364,20 @@ pub fn decode_text(data: &[u8], cipher: u16) -> String { } pub fn create_stringmap() -> anyhow::Result { - if matches!( - package_manager().version, + // TODO: Change this match to use ordered version checking after destiny-pkg 0.11 + match package_manager().version { PackageVersion::Destiny2Shadowkeep - | PackageVersion::Destiny2BeyondLight - | PackageVersion::Destiny2WitchQueen - | PackageVersion::Destiny2Lightfall - // cohae: Rise of Iron uses the same string format as D2 - | PackageVersion::DestinyRiseOfIron - ) { - create_stringmap_d2() - } else if package_manager().version == PackageVersion::DestinyTheTakenKing { - create_stringmap_d1() - } else if package_manager().version == PackageVersion::DestinyInternalAlpha { - create_stringmap_d1_devalpha() - } else { - warn!( - "{:?} does not support string loading", - package_manager().version - ); - Ok(StringCache::default()) + | PackageVersion::Destiny2BeyondLight + | PackageVersion::Destiny2WitchQueen + | PackageVersion::Destiny2Lightfall + | PackageVersion::Destiny2TheFinalShape + // cohae: Rise of Iron uses the same string format as D2 + | PackageVersion::DestinyRiseOfIron => create_stringmap_d2(), + PackageVersion::DestinyTheTakenKing => create_stringmap_d1(), + PackageVersion::DestinyInternalAlpha => create_stringmap_d1_devalpha(), + u => + panic!("Unsupported game version {u:?} (create_stringmap)") + } }