diff --git a/server/gameserver/car.cc b/server/gameserver/car.cc index 12ea464..9730630 100644 --- a/server/gameserver/car.cc +++ b/server/gameserver/car.cc @@ -147,7 +147,7 @@ void Car::GetOn(Human* passenger) passengers_.insert(passenger); if (!driver_) { driver_ = passenger; - driver_->SetAttackDir(a8::Vec2::UP); + driver_->SetAttackDir(a8::Vec2::RIGHT); SetAttackDir(driver_->GetAttackDir()); } passenger->SetCar(this); @@ -393,3 +393,8 @@ bool Car::IsPassenger(Human* hum) { return passengers_.find(hum) != passengers_.end(); } + +void Car::SetAttackDir(const a8::Vec2& attack_dir) +{ + Creature::SetAttackDir(attack_dir); +} diff --git a/server/gameserver/car.h b/server/gameserver/car.h index 33ce659..30ff654 100644 --- a/server/gameserver/car.h +++ b/server/gameserver/car.h @@ -38,13 +38,13 @@ class Car : public Creature virtual float GetSpeed() override; virtual void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id) override; virtual void SendDebugMsg(const std::string& debug_msg) override; + virtual void SetAttackDir(const a8::Vec2& attack_dir) override; private: int AllocSeat(); void BeKill(int killer_id, const std::string& killer_name, int weapon_id); void Explosion(int team_id); bool IsPassenger(Human* hum); - private: long long born_frameno_ = 0; bool later_removed_ = false; diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index b900bf5..36b6e23 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -108,15 +108,6 @@ void Player::InternalUpdate(int delta_time) if (jump) { UpdateJump(); } - if (get_down) { - UpdateGetDown(); - } - if (get_on) { - UpdateGetOn(); - } - if (switch_seat) { - UpdateSwitchSeat(); - } if (shot_start || shot_hold) { UpdateShot(); } @@ -130,6 +121,15 @@ void Player::InternalUpdate(int delta_time) if (playing_skill) { UpdateSkill(); } + if (get_down) { + UpdateGetDown(); + } + if (get_on) { + UpdateGetOn(); + } + if (switch_seat) { + UpdateSwitchSeat(); + } } } @@ -1049,7 +1049,8 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg) std::abs(msg.attack_dir().y()) > 0.00001f ) ){ - if (!HasBuffEffect(kBET_Vertigo)) { + if (!HasBuffEffect(kBET_Vertigo) && + !(GetCar() && GetCar()->HasBuffEffect(kBET_Vertigo))) { a8::Vec2 attack_dir; TypeConvert::FromPb(attack_dir, &msg.attack_dir()); attack_dir.Normalize(); @@ -1057,6 +1058,8 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg) if (GetCar() && GetCar()->IsDriver(this)) { GetCar()->SetAttackDir(GetAttackDir()); } + } else { + int i = 0; } } } else {