From 44487e48ec0ed4e93caccc23769366246a73fda3 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 20 Mar 2023 18:54:34 +0800 Subject: [PATCH] 1 --- server/gameserver/bullet.cc | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/server/gameserver/bullet.cc b/server/gameserver/bullet.cc index bb6211c0..de7adeb9 100644 --- a/server/gameserver/bullet.cc +++ b/server/gameserver/bullet.cc @@ -398,24 +398,26 @@ void Bullet::MapServiceUpdate() auto old_pos = GetPos(); GetMutablePos().AddGlmVec3(dir * step_len); float distance = GetPos().DistanceGlmVec3(born_pos.ToGlmVec3()); -#ifdef DEBUG1 +#ifdef DEBUG + if (IsFlyHook()) { a8::XPrintf("step_len:%f born_pos:%f,%f,%f curr_pos:%f,%f,%f old_pos:%f,%f,%f distance:%f\n", { step_len, - born_pos.x, - born_pos.y, - born_pos.z, + born_pos.GetX(), + born_pos.GetY(), + born_pos.GetZ(), - old_pos.x, - old_pos.y, - old_pos.z, + old_pos.GetX(), + old_pos.GetY(), + old_pos.GetZ(), - GetPos().x, - GetPos().y, - GetPos().z, + GetPos().GetX(), + GetPos().GetY(), + GetPos().GetZ(), - distance + distance }); + } #endif if (room->OverBorder(GetPos().ToGlmVec3(), gun_meta->bullet_rad())) { if (IsBomb()) { @@ -930,6 +932,11 @@ void Bullet::ProcNormalBullet(BulletCheckResult& result) } if (need_remove) { if (IsFlyHook()) { +#ifdef DEBUG + a8::XPrintf("ProcHookHit\n", + { + }); +#endif if (!hited) { if (raycast_hited) { if (result.flyed_distance > 0.001f) { @@ -1015,13 +1022,14 @@ void Bullet::Raycast() raycast_len_ = gun_meta->range(); } #ifdef DEBUG - a8::XPrintf("bullet.raycast ret:%d hit_result:%d raycast_hit_point_:%f,%f,%f\n", + a8::XPrintf("bullet.raycast ret:%d hit_result:%d raycast_hit_point_:%f,%f,%f speed:%f\n", { ret, hit_result, raycast_hit_point_.x, raycast_hit_point_.y, raycast_hit_point_.z, + gun_meta->bullet_speed() }); #endif }