修复乘客瞄准时都会影响机甲朝向

This commit is contained in:
aozhiwei 2021-05-25 10:31:41 +08:00
parent b1027359e0
commit 9ca019624b

View File

@ -195,12 +195,16 @@ void Player::UpdateShot()
bool shot_ok = false;
a8::Vec2 target_dir = GetAttackDir();
a8::Vec2 old_car_shoot_offset = GetCar()->shoot_offset;
a8::Vec2 old_car_attack_dir = GetCar()->GetAttackDir();
GetCar()->shoot_offset = shoot_offset;
GetCar()->SetAttackDir(GetAttackDir());
GetCar()->Shot(target_dir, shot_ok, fly_distance);
if (!moving && GetCar()->IsDriver(this)) {
GetCar()->SetMoveDir(GetAttackDir());
}
if (!GetCar()->IsDriver(this)) {
GetCar()->SetAttackDir(old_car_attack_dir);
}
GetCar()->shoot_offset = old_car_shoot_offset;
}
shot_start = false;