From 0330cf3b2b6e702218eae5ddbba63a1b9a7cd0a0 Mon Sep 17 00:00:00 2001 From: dawnDus <96957561+dawndus@users.noreply.github.com> Date: Sat, 12 Nov 2022 17:11:03 -0500 Subject: [PATCH] Fix MYB bumping away from NPC when direction >4 --- src/scripting/tsc/text_script.rs | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/scripting/tsc/text_script.rs b/src/scripting/tsc/text_script.rs index b101e77..2009dc1 100644 --- a/src/scripting/tsc/text_script.rs +++ b/src/scripting/tsc/text_script.rs @@ -794,27 +794,27 @@ impl TextScriptVM { game_scene.player1.vel_y = 0x200; game_scene.player2.vel_y = 0x200; } - Direction::FacingPlayer => { - for npc in game_scene.npc_list.iter_alive() { - if npc.event_num == new_direction as u16 { - if game_scene.player1.x >= npc.x { - game_scene.player1.direction = Left; - game_scene.player1.vel_x = 0x200; - } else { - game_scene.player1.direction = Right; - game_scene.player1.vel_x = -0x200; - } - - if game_scene.player2.x >= npc.x { - game_scene.player2.direction = Left; - game_scene.player2.vel_x = 0x200; - } else { - game_scene.player2.direction = Right; - game_scene.player2.vel_x = -0x200; - } - break; - } + _ => (), + } + } else { + for npc in game_scene.npc_list.iter_alive() { + if npc.event_num == new_direction as u16 { + if game_scene.player1.x >= npc.x { + game_scene.player1.direction = Left; + game_scene.player1.vel_x = 0x200; + } else { + game_scene.player1.direction = Right; + game_scene.player1.vel_x = -0x200; } + + if game_scene.player2.x >= npc.x { + game_scene.player2.direction = Left; + game_scene.player2.vel_x = 0x200; + } else { + game_scene.player2.direction = Right; + game_scene.player2.vel_x = -0x200; + } + break; } } }