This commit is contained in:
aozhiwei 2021-08-30 08:52:52 +00:00
parent 6b48c7fd66
commit 164a0b0a3d

View File

@ -204,24 +204,24 @@ void RoomObstacle::SpecExplosion()
meta->i->damage() meta->i->damage()
); );
if (master.Get()) { if (master.Get()) {
std::set<Human*> human_list; std::set<Creature*> target_list;
room->grid_service->TraverseAllLayerHumanList room->grid_service->TraverseCreatures
(room->GetRoomIdx(), (room->GetRoomIdx(),
*grid_list_, *grid_list_,
[this, &human_list, &bomb_pos] (Human* hum, bool& stop) [this, &target_list, &bomb_pos] (Creature* c, bool& stop)
{ {
if (master.Get()->team_id != hum->team_id && if (master.Get()->team_id != c->team_id &&
bomb_pos.Distance(hum->GetPos()) < meta->i->damage_dia()) { bomb_pos.Distance(c->GetPos()) < meta->i->damage_dia()) {
human_list.insert(hum); target_list.insert(c);
} }
} }
); );
if (!human_list.empty()) { if (!target_list.empty()) {
for (Human* hum : human_list) { for (Creature* c : target_list) {
for (int buff_id : meta->buff_list) { for (int buff_id : meta->buff_list) {
MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id); MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id);
if (buff_meta) { if (buff_meta) {
hum->AddBuff(master.Get(), c->AddBuff(master.Get(),
buff_meta, buff_meta,
1); 1);
} }