This commit is contained in:
aozhiwei 2023-06-20 14:41:37 +08:00
parent cf9611cce2
commit 792348a8a7

View File

@ -300,6 +300,7 @@ void Player::UpdateMoving()
UpdateMove();
Global::Instance()->verify_set_pos = 0;
if (GetCar() && GetCar()->IsDriver(this)) {
if (!GetCar()->HasBuffEffect(kBET_Sprint)) {
GetCar()->SyncPos();
float dec_oil = old_pos.Distance2D2(GetPos()) * GetCar()->meta->average_oil() / 100;
GetCar()->DecOil(dec_oil);
@ -308,6 +309,7 @@ void Player::UpdateMoving()
GetCar()->GetCurOil(),
GetCar()->GetMaxOil());
}
}
#ifdef DEBUG
room->CheckPartObjects();
#endif
@ -992,10 +994,12 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg)
GlmHelper::Normalize(attack_dir);
SetAttackDir(attack_dir);
if (GetCar() && GetCar()->IsDriver(this)) {
if (!GetCar()->HasBuffEffect(kBET_Sprint)) {
GetCar()->SetAttackDir(GetAttackDir());
}
}
}
}
#ifdef DEBUG1
a8::XPrintf("attack_dir:%f,%f,%f cli_dir:%f,%f,%f\n",
{
@ -1022,10 +1026,12 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg)
SetAttackDir(GetMoveDir());
}
if (GetCar() && GetCar()->IsDriver(this)) {
if (!GetCar()->HasBuffEffect(kBET_Sprint)) {
GetCar()->SetAttackDir(GetAttackDir());
}
}
}
}
#if 1
moved_frames = 0;
#else