1
This commit is contained in:
parent
a4f68c9147
commit
a698ab16cb
@ -907,12 +907,21 @@ void RoomObstacle::ActiveFlameSurface()
|
|||||||
auto cb =
|
auto cb =
|
||||||
[this, adjusted_pos] ()
|
[this, adjusted_pos] ()
|
||||||
{
|
{
|
||||||
std::set<Human*> human_list;
|
std::vector<Human*> human_list;
|
||||||
room->grid_service->TraverseAllLayerHumanList
|
room->grid_service->TraverseAllLayerHumanList
|
||||||
(room->GetRoomIdx(),
|
(room->GetRoomIdx(),
|
||||||
*grid_list_,
|
*grid_list_,
|
||||||
[this, &human_list, &adjusted_pos] (Human* hum, bool& stop)
|
[this, &human_list, &adjusted_pos] (Human* hum, bool& stop)
|
||||||
{
|
{
|
||||||
|
if (hum->dead) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!master.Get()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (master.Get()->team_id == hum->team_id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (Collision::Check2dRotationRectangle
|
if (Collision::Check2dRotationRectangle
|
||||||
(
|
(
|
||||||
hum->GetPos().GetX(),
|
hum->GetPos().GetX(),
|
||||||
@ -920,13 +929,25 @@ void RoomObstacle::ActiveFlameSurface()
|
|||||||
hum->GetHitRadius(),
|
hum->GetHitRadius(),
|
||||||
adjusted_pos.x,
|
adjusted_pos.x,
|
||||||
adjusted_pos.z,
|
adjusted_pos.z,
|
||||||
meta->width() / 2.0f,
|
meta->width(),
|
||||||
meta->height() / 2.0f,
|
meta->height() / 2.0f,
|
||||||
GetRotate() * 180.f
|
GetRotate() * 180.f
|
||||||
)) {
|
)) {
|
||||||
|
human_list.push_back(hum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
for (auto& hum : human_list) {
|
||||||
|
for (int buff_id : meta->_buff_list) {
|
||||||
|
if (!hum->GetBuffById(buff_id)) {
|
||||||
|
hum->TryAddBuff(master.Get(),
|
||||||
|
buff_id);
|
||||||
|
#ifdef MYDEBUG
|
||||||
|
a8::XPrintf("火焰枪地面命中\n", {});
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
room->xtimer.SetIntervalEx
|
room->xtimer.SetIntervalEx
|
||||||
(
|
(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user