| 894 | } |
| 895 | |
| 896 | void testLockFacing(lcf::rpg::EventPage::AnimType at) { |
| 897 | const MapGuard mg; |
| 898 | |
| 899 | auto ch = MoveRouteVehicle(); |
| 900 | ch.SetAnimationType(at); |
| 901 | auto mr = MakeRoute(static_cast<int>(lcf::rpg::MoveCommand::Code::lock_facing)); |
| 902 | |
| 903 | ch.ForceMoveRoute(mr, 2); |
| 904 | testMoveRoute(ch, false, 2, 0xFFFF, 0, 0, true, false, mr); |
| 905 | REQUIRE_EQ(ch.IsFacingLocked(), Game_Character::IsDirectionFixedAnimationType(at)); |
| 906 | |
| 907 | ForceUpdate(ch); |
| 908 | testMoveRoute(ch, false, 2, 0xFFFF + 1, 128, 1, false, false, mr); |
| 909 | REQUIRE(ch.IsFacingLocked()); |
| 910 | |
| 911 | mr = MakeRoute(static_cast<int>(lcf::rpg::MoveCommand::Code::unlock_facing)); |
| 912 | ch.ForceMoveRoute(mr, 2); |
| 913 | testMoveRoute(ch, false, 2, 0xFFFF, 128, 0, true, false, mr); |
| 914 | REQUIRE(ch.IsFacingLocked()); |
| 915 | |
| 916 | ForceUpdate(ch); |
| 917 | testMoveRoute(ch, false, 2, 0xFFFF + 1, 128, 1, false, false, mr); |
| 918 | REQUIRE_EQ(ch.IsFacingLocked(), Game_Character::IsDirectionFixedAnimationType(at)); |
| 919 | } |
| 920 | |
| 921 | TEST_CASE("CommandLockFacing") { |
| 922 | for (int i = 0; i <= static_cast<int>(lcf::rpg::EventPage::AnimType_step_frame_fix); ++i) { |
no test coverage detected