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