修复乘客瞄准时都会影响机甲朝向
This commit is contained in:
parent
b1027359e0
commit
9ca019624b
@ -195,12 +195,16 @@ void Player::UpdateShot()
|
|||||||
bool shot_ok = false;
|
bool shot_ok = false;
|
||||||
a8::Vec2 target_dir = GetAttackDir();
|
a8::Vec2 target_dir = GetAttackDir();
|
||||||
a8::Vec2 old_car_shoot_offset = GetCar()->shoot_offset;
|
a8::Vec2 old_car_shoot_offset = GetCar()->shoot_offset;
|
||||||
|
a8::Vec2 old_car_attack_dir = GetCar()->GetAttackDir();
|
||||||
GetCar()->shoot_offset = shoot_offset;
|
GetCar()->shoot_offset = shoot_offset;
|
||||||
GetCar()->SetAttackDir(GetAttackDir());
|
GetCar()->SetAttackDir(GetAttackDir());
|
||||||
GetCar()->Shot(target_dir, shot_ok, fly_distance);
|
GetCar()->Shot(target_dir, shot_ok, fly_distance);
|
||||||
if (!moving && GetCar()->IsDriver(this)) {
|
if (!moving && GetCar()->IsDriver(this)) {
|
||||||
GetCar()->SetMoveDir(GetAttackDir());
|
GetCar()->SetMoveDir(GetAttackDir());
|
||||||
}
|
}
|
||||||
|
if (!GetCar()->IsDriver(this)) {
|
||||||
|
GetCar()->SetAttackDir(old_car_attack_dir);
|
||||||
|
}
|
||||||
GetCar()->shoot_offset = old_car_shoot_offset;
|
GetCar()->shoot_offset = old_car_shoot_offset;
|
||||||
}
|
}
|
||||||
shot_start = false;
|
shot_start = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user