This commit is contained in:
aozhiwei 2023-12-15 11:46:22 +08:00
parent 4fa3d1e7a5
commit 1dfc10cad9
4 changed files with 20 additions and 2 deletions

View File

@ -101,7 +101,7 @@ void Bullet::Initialize()
void Bullet::Update(int delta_time)
{
if (shot_animi_time <= (room->GetFrameNo() - create_frameno_) * FRAME_RATE_MS) {
if (!trace_target_id && !reporter_list) {
if (!trace_target_id && !reporter_list && !IsClientHook()) {
MapServiceUpdate();
++updated_times_;
}
@ -1148,7 +1148,15 @@ bool Bullet::NoAdjustPos()
void Bullet::ReportHookHitPos(const glm::vec3& hit_pos)
{
if (later_removed_) {
return;
}
if (sender.Get()) {
float distance = GetPos().Distance2D2(hit_pos) + 3;
GetMutablePos().FromGlmVec3(hit_pos);
room->grid_service->MoveBullet(this);
Check(distance);
}
}
bool Bullet::IsClientHook()

View File

@ -131,6 +131,7 @@ void HandlerMgr::RegisterNetMsgHandlers()
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMTeamMarkTargetPos);
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMSetRevivePosition);
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMGetSettlementTeamList);
RegisterNetMsgHandler(&ggmsghandler, &Player::_CMReportHookHitPos);
}
void HandlerMgr::ProcGMMsg(unsigned long saddr, int sockhandle,

View File

@ -1808,6 +1808,14 @@ void Player::_CMGetSettlementTeamList(f8::MsgHdr* hdr, const cs::CMGetSettlement
void Player::_CMReportHookHitPos(f8::MsgHdr* hdr, const cs::CMReportHookHitPos& msg)
{
#ifdef MYDEBUG
a8::XPrintf("CMReportHookHitPos id:%d pos:%d %d %d\n",
{msg.bullet_uniid(),
msg.pos().x(),
msg.pos().y(),
msg.pos().z(),
});
#endif
Entity* e = room->GetEntityByUniId(msg.bullet_uniid());
if (e && e->GetEntityType() == ET_Bullet) {
Bullet* b = (Bullet*)e;

View File

@ -1630,6 +1630,7 @@ message CMReportHookHitPos
{
optional int32 bullet_uniid = 1; //id
optional MFVec3 pos = 2; //
optional int32 hit_obj_uniid = 3; //uniid,
}
//endcmmsg