1
This commit is contained in:
parent
4fa3d1e7a5
commit
1dfc10cad9
@ -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()
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -1630,6 +1630,7 @@ message CMReportHookHitPos
|
||||
{
|
||||
optional int32 bullet_uniid = 1; //子弹唯一id
|
||||
optional MFVec3 pos = 2; //位置
|
||||
optional int32 hit_obj_uniid = 3; //抓住的对象uniid,无则为空
|
||||
}
|
||||
|
||||
//endcmmsg
|
||||
|
Loading…
x
Reference in New Issue
Block a user