diff --git a/server/gameserver/buff/callfunc.cc b/server/gameserver/buff/callfunc.cc index bbc76887..32098727 100644 --- a/server/gameserver/buff/callfunc.cc +++ b/server/gameserver/buff/callfunc.cc @@ -1025,7 +1025,7 @@ void CallFuncBuff::RangeHoldBuff() () { float range = meta->GetBuffParam2(this); - std::vector hit_humans; + std::set hit_humans; owner->room->TraverseAliveHumanList ( [this, range] (Human* hum) @@ -1037,16 +1037,7 @@ void CallFuncBuff::RangeHoldBuff() }); std::vector leave_humans; for (auto& pair : context->in_human_infos) { - bool found = false; - #if 0 - for (int i = 0; i < size; ++i){ - if (hit_humans[i] == pair.second.c.Get()) { - found = true; - break; - } - } - #endif - if (!found) { + if (hit_humans.find(pair.second.c.Get()) == hit_humans.end()) { on_leave(pair.second.c.Get()->AsHuman()); leave_humans.push_back(pair.second.c.Get()->AsHuman()); }