This commit is contained in:
aozhiwei 2021-07-21 07:27:12 +00:00
parent 88258b5371
commit 47734c0917

View File

@ -1056,8 +1056,19 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg)
std::abs(msg.attack_dir().y()) > 0.00001f
)
){
if (!HasBuffEffect(kBET_Vertigo) &&
!(GetCar() && (GetCar()->HasBuffEffect(kBET_Vertigo) || !GetCar()->HasOil()))) {
bool can_set = true;
if (HasBuffEffect(kBET_Vertigo)) {
can_set = HasBuffEffect(kBET_AutoShot);
} else if (GetCar()) {
if (GetCar()->HasOil()) {
if (GetCar()->HasBuffEffect(kBET_Vertigo)) {
can_set = GetCar()->HasBuffEffect(kBET_AutoShot);
}
} else {
can_set = false;
}
}
if (can_set) {
a8::Vec2 attack_dir;
TypeConvert::FromPb(attack_dir, &msg.attack_dir());
attack_dir.Normalize();
@ -1065,8 +1076,6 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg)
if (GetCar() && GetCar()->IsDriver(this)) {
GetCar()->SetAttackDir(GetAttackDir());
}
} else {
int i = 0;
}
}
} else {