From 544e5b6e67a060625bd50c4a5746cb01a4d6570e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 28 Apr 2024 10:45:09 +0800 Subject: [PATCH] 1 --- server/gameserver/constant.h | 1 + server/gameserver/frameevent.cc | 30 ++++++++++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/server/gameserver/constant.h b/server/gameserver/constant.h index 5c287bac..77d239b6 100644 --- a/server/gameserver/constant.h +++ b/server/gameserver/constant.h @@ -199,6 +199,7 @@ enum GunSubEquipType_e GUN_SUB_EQUIP_TYPE_THREE_GUN = 9, GUN_SUB_EQUIP_TYPE_LASER_CANNON = 10, GUN_SUB_EQUIP_TYPE_FLY_HOOk = 14, + GUN_SUB_EQUIP_TYPE_FLY_LASER = 15, GUN_SUB_EQUIP_TYPE_End }; diff --git a/server/gameserver/frameevent.cc b/server/gameserver/frameevent.cc index de7f53c4..be3ded58 100644 --- a/server/gameserver/frameevent.cc +++ b/server/gameserver/frameevent.cc @@ -125,18 +125,28 @@ void FrameEvent::AddBullet(int bullet_uniid, } { int bullet_idx = room->frame_event_data->bullets_.size() - 1; - sender.Get()->TraverseAllLayerHumanList - ( - [bullet_idx, &sender] (Human* hum, bool& stop) - { + if (weapon_meta->equip_subtype() == GUN_SUB_EQUIP_TYPE_FLY_LASER) { + sender.Get()->room->TraverseHumanList + ( + [bullet_idx] (Human* hum) -> bool + { + hum->GetFrameData().bullets_.push_back(bullet_idx); + return true; + }); + } else { + sender.Get()->TraverseAllLayerHumanList + ( + [bullet_idx, &sender] (Human* hum, bool& stop) + { #ifdef MYDEBUG1 - // 999 - if (!hum->InPartObjects(sender.Get())) { - A8_ABORT(); - } + // 999 + if (!hum->InPartObjects(sender.Get())) { + A8_ABORT(); + } #endif - hum->GetFrameData().bullets_.push_back(bullet_idx); - }); + hum->GetFrameData().bullets_.push_back(bullet_idx); + }); + } } }