···1414 script.read_to_string(&mut script_txt).await.expect("Cannot read script");
1515 drop(script);
16161717- let patched_script = script_txt.replace("OS.window_borderless = PlayerData.player_options.fullscreen == 1", "\n");
1717+ let patched_script = script_txt.replace("OS.window_borderless = PlayerData.player_options.fullscreen == 1", "OS.window_borderless\n");
1818 let mut script = File::create(SCRIPT_PATH).await.expect("Cannot open script");
1919 script.write_all(patched_script.as_bytes()).await.expect("Cannot write");
2020 drop(script);
···3030 let mut compiled_pck = File::open(GAME_PCK).await.expect("Cannot open pck");
3131 compiled_pck.read_to_end(&mut compiled_pck_bytes).await.expect("Cannot read");
3232 drop(compiled_pck);
3333+ let mut compiled_pck_bytes: Vec<u8> = compiled_pck_bytes.into_iter().rev().skip_while(|b| (*b) == 0).collect::<Vec<u8>>().into_iter().rev().collect();
33343434- for _ in 0..16 - (compiled_script_bytes.len() % 16) {
3535- compiled_script_bytes.push(0);
3535+ if compiled_script_bytes.len() % 16 > 0 {
3636+ let to_add = 16 - (compiled_script_bytes.len() % 16);
3737+ for _ in 0..to_add {
3838+ compiled_script_bytes.push(0);
3939+ }
3640 }
37413842 let mut tsc_bytes = Vec::new();
···4145 drop(tsc);
42464347 compiled_script_bytes.append(&mut tsc_bytes);
4444- for _ in 0..16 - (compiled_script_bytes.len() % 16) {
4545- compiled_script_bytes.push(0);
4848+ let mut compiled_pck_bytes: Vec<u8> = compiled_pck_bytes.into_iter().rev().skip_while(|b| (*b) == 0).collect::<Vec<u8>>().into_iter().rev().collect();
4949+ if compiled_script_bytes.len() % 16 > 0 {
5050+ let to_add = 16 - (compiled_script_bytes.len() % 16);
5151+ for _ in 0..to_add {
5252+ compiled_script_bytes.push(0);
5353+ }
4654 }
47554856 replace_slice(&mut compiled_pck_bytes,
+1-1
src/utils/gd_utils.rs
···77where
88 T: Clone + PartialEq + From<u8>,
99{
1010- for i in 0..=buf.len() - replace_with.len() {
1010+ for mut i in 0..=buf.len() - replace_with.len() {
1111 if buf[i..].starts_with(from) {
1212 for j in (i + 1)..=buf.len() {
1313 if buf[j..].starts_with(to) {