From ca6a1191eea1cd8b936f0265036e13ae19116d78 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 19 Jan 2024 19:25:10 +0800 Subject: [PATCH] 1 --- server/gameserver/buff/callfunc.cc | 2 +- server/gameserver/creature.cc | 5 ++++- server/gameserver/shot.cc | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/server/gameserver/buff/callfunc.cc b/server/gameserver/buff/callfunc.cc index 46e81ed2..504e0c94 100644 --- a/server/gameserver/buff/callfunc.cc +++ b/server/gameserver/buff/callfunc.cc @@ -1463,7 +1463,7 @@ void CallFuncBuff::Shot() auto on_bullet_exit = [owner_wp, buff_uniid_copy, meta_copy] (Bullet* bullet) mutable { - if (owner_wp.Get()) { + if (owner_wp.Get() && !owner_wp.Get()->IsDestorying()) { std::shared_ptr> vars = std::make_shared>(); vars->push_back(bullet->GetPos().GetX()); vars->push_back(bullet->GetPos().GetY()); diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 6b1a5b20..1caff6b4 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -3344,7 +3344,10 @@ std::shared_ptr> Creature::CalcReporterList(bool is_trace_bullet, break; } if (weapon_meta->equip_subtype() == GUN_SUB_EQUIP_TYPE_THREE_GUN) { - need_gen = true; + need_gen = true; + } + if (GetAbility()->GetSwitchTimes(kForceClientReportBullet) > 0) { + need_gen = true; } if (need_gen) { float nearest_distance = FLT_MAX; diff --git a/server/gameserver/shot.cc b/server/gameserver/shot.cc index b7efe5d2..124d1e35 100644 --- a/server/gameserver/shot.cc +++ b/server/gameserver/shot.cc @@ -55,6 +55,7 @@ struct BulletInfo std::shared_ptr> reporter_list; int shot_uniid = 0; a8::XTimerWp keep_shot_animi_timer_ptr; + bool ignore_original_dmg = false; }; static void CalcGunMuzzlePosition(Creature* c, @@ -500,6 +501,7 @@ void InternalShot(Creature* c, bullet_info.weapon_lv = weapon_lv; bullet_info.weapon_buff_id = weapon_buff_id; bullet_info.reporter_list = c->CalcReporterList(trace_target_uniid, weapon_meta, bullet_meta); + bullet_info.ignore_original_dmg = c->GetAbility()->GetSwitchTimes(kIgnoreOriginalDmg) > 0; if (weapon_meta->double_gun() && bulletIdx > (int)(bulletNum / 2)) { bullet_info.hand = 1;