From 50e60fd57d3f72d9a4208fbb70eeec1c41d64d14 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 1 Apr 2023 14:35:57 +0800 Subject: [PATCH] 1 --- server/gameserver/airdrop.cc | 11 +++-------- server/gameserver/airdrop.h | 3 +++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/server/gameserver/airdrop.cc b/server/gameserver/airdrop.cc index 19ff1ba3..27e5791b 100644 --- a/server/gameserver/airdrop.cc +++ b/server/gameserver/airdrop.cc @@ -8,6 +8,7 @@ #include "mt/AirDrop.h" #include "mt/MapThing.h" +#include "mt/Hero.h" AirDrop::AirDrop(Room* room) { @@ -79,17 +80,13 @@ void AirDrop::Exec(int appear_time, int box_id, int airdrop_id) }, &room_->xtimer_attacher_); ++airdrop_times_; - #if 0 ShuaMon(box_pos, - thing_meta->airdrop_mon_list, + thing_meta->_airdrop_mon_list, std::max(thing_meta->width(), thing_meta->height())); - #endif } } -#if 0 - -void Room::ShuaMon(const glm::vec3& center, std::vector& airdrop_mon_list, float radius) +void AirDrop::ShuaMon(const glm::vec3& center, const std::vector& airdrop_mon_list, float radius) { int last_hero_idx = 0; for (int hero_id : airdrop_mon_list) { @@ -149,5 +146,3 @@ void Room::ShuaMon(const glm::vec3& center, std::vector& airdrop_mon_list, }//end if }//end for hero_id } - -#endif diff --git a/server/gameserver/airdrop.h b/server/gameserver/airdrop.h index 0b958d2f..54c9f5a2 100644 --- a/server/gameserver/airdrop.h +++ b/server/gameserver/airdrop.h @@ -11,6 +11,9 @@ class AirDrop private: void Exec(int appear_time, int box_id, int airdrop_id); + void ShuaMon(const glm::vec3& center, + const std::vector& airdrop_mon_list, + float radius); private: Room* room_ = nullptr;