# HG changeset patch
# User Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
# Date 1661871782 -7200
# Node ID 2a5279168d5a42dc57757c06a88899935ddea6af
# Parent  d18c0bf111381775494ff70d60e25cc91fc8724e
formats: Use a BTreeMap instead of a HashMap for scripts

diff --git a/formats/src/th06/anm0.rs b/formats/src/th06/anm0.rs
--- a/formats/src/th06/anm0.rs
+++ b/formats/src/th06/anm0.rs
@@ -7,7 +7,7 @@ use nom::{
     sequence::tuple,
     multi::{many_m_n, many0},
 };
-use std::collections::HashMap;
+use std::collections::BTreeMap;
 
 /// Coordinates of a sprite into the image.
 #[derive(Debug, Clone)]
@@ -45,7 +45,7 @@ pub struct Script {
     pub instructions: Vec<Call>,
 
     /// List of interrupts in this script.
-    pub interrupts: HashMap<i32, u8>
+    pub interrupts: BTreeMap<i32, u8>
 }
 
 /// Main struct of the ANM0 animation format.
@@ -67,7 +67,7 @@ pub struct Anm0 {
     pub sprites: Vec<Sprite>,
 
     /// A map of scripts.
-    pub scripts: HashMap<u8, Script>,
+    pub scripts: BTreeMap<u8, Script>,
 }
 
 impl Anm0 {
@@ -216,7 +216,7 @@ fn parse_anm0(input: &[u8]) -> IResult<&
         sprites.push(sprite);
     }
 
-    let mut scripts = HashMap::new();
+    let mut scripts = BTreeMap::new();
     for (index, offset) in script_offsets.into_iter().map(|(index, offset)| (index as u8, offset as usize)) {
         if input.len() < offset {
             return Err(nom::Err::Failure(nom::error::Error::new(input, nom::error::ErrorKind::Eof)));
@@ -237,7 +237,7 @@ fn parse_anm0(input: &[u8]) -> IResult<&
                 break;
             }
         }
-        let mut interrupts = HashMap::new();
+        let mut interrupts = BTreeMap::new();
         let mut j = 0;
         for Call { time: _, instr } in &mut instructions {
             match instr {