From 9ca019624b5a4cf02ffe8fc2e18f939d64e16b8e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 25 May 2021 10:31:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B9=98=E5=AE=A2=E7=9E=84?= =?UTF-8?q?=E5=87=86=E6=97=B6=E9=83=BD=E4=BC=9A=E5=BD=B1=E5=93=8D=E6=9C=BA?= =?UTF-8?q?=E7=94=B2=E6=9C=9D=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/player.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index c4d2058..dfcda0b 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -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;