This commit is contained in:
aozhiwei 2021-06-15 23:19:29 +08:00
parent 846337646f
commit 396edd9845
2 changed files with 7 additions and 1 deletions

View File

@ -411,6 +411,12 @@ void Car::DecOil(float dec_oil)
{
cur_oil_ -= dec_oil;
cur_oil_ = std::max(0.0f, cur_oil_);
if (!HasOil()) {
if (driver_) {
driver_->SetAttackDir(a8::Vec2::RIGHT);
}
SetAttackDir(a8::Vec2::RIGHT);
}
}
float Car::GetMaxOil()

View File

@ -1037,7 +1037,7 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg)
)
){
if (!HasBuffEffect(kBET_Vertigo) &&
!(GetCar() && GetCar()->HasBuffEffect(kBET_Vertigo))) {
!(GetCar() && (GetCar()->HasBuffEffect(kBET_Vertigo) || !GetCar()->HasOil()))) {
a8::Vec2 attack_dir;
TypeConvert::FromPb(attack_dir, &msg.attack_dir());
attack_dir.Normalize();