17.空袭,召唤无法生成爆炸物件
This commit is contained in:
parent
0052468f93
commit
ce41c8a051
@ -3949,6 +3949,7 @@ void Room::AirRaid(int airraid_id)
|
|||||||
pos.x,
|
pos.x,
|
||||||
pos.y
|
pos.y
|
||||||
);
|
);
|
||||||
|
obstacle->Active();
|
||||||
if (obstacle) {
|
if (obstacle) {
|
||||||
}
|
}
|
||||||
#if 1
|
#if 1
|
||||||
|
@ -283,21 +283,29 @@ void RoomObstacle::SpecExplosion()
|
|||||||
bomb_born_offset = bomb_born_offset * a8::RandEx(1, std::max(2, meta->i->explosion_float()));
|
bomb_born_offset = bomb_born_offset * a8::RandEx(1, std::max(2, meta->i->explosion_float()));
|
||||||
a8::Vec2 bomb_pos = GetPos() + bomb_born_offset;
|
a8::Vec2 bomb_pos = GetPos() + bomb_born_offset;
|
||||||
std::set<Entity*> objects;
|
std::set<Entity*> objects;
|
||||||
|
Creature* dumy_c = nullptr;
|
||||||
room->grid_service->TraverseAllLayerHumanList
|
room->grid_service->TraverseAllLayerHumanList
|
||||||
(
|
(
|
||||||
room->GetRoomIdx(),
|
room->GetRoomIdx(),
|
||||||
*grid_list_,
|
*grid_list_,
|
||||||
[this, &objects, &bomb_pos] (Human* hum, bool& stop)
|
[this, &objects, &bomb_pos, &dumy_c] (Human* hum, bool& stop)
|
||||||
{
|
{
|
||||||
|
if (!dumy_c) {
|
||||||
|
dumy_c = hum;
|
||||||
|
}
|
||||||
float distance = (hum->GetPos() - bomb_pos).Norm();
|
float distance = (hum->GetPos() - bomb_pos).Norm();
|
||||||
if (master.Get()->team_id != hum->team_id && distance < meta->i->damage_dia()) {
|
if ((!master.Get() || master.Get()->team_id != hum->team_id) &&
|
||||||
objects.insert(hum);
|
distance < meta->i->damage_dia()) {
|
||||||
|
dumy_c = hum;
|
||||||
|
objects.insert(hum);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
room->frame_event.AddExplosionEx(master,
|
if (dumy_c) {
|
||||||
meta->i->thing_id(),
|
room->frame_event.AddExplosionEx(dumy_c->GetWeakPtrRef(),
|
||||||
bomb_pos,
|
meta->i->thing_id(),
|
||||||
meta->i->explosion_effect());
|
bomb_pos,
|
||||||
|
meta->i->explosion_effect());
|
||||||
|
}
|
||||||
for (auto& target : objects) {
|
for (auto& target : objects) {
|
||||||
switch (target->GetEntityType()) {
|
switch (target->GetEntityType()) {
|
||||||
case ET_Player:
|
case ET_Player:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user