1
This commit is contained in:
parent
c421fa1359
commit
dec6cf2cb3
@ -67,11 +67,9 @@ void AirRaid::Exec(int airraid_id)
|
||||
|
||||
bool AirRaid::GenAirRaidPos(const mt::AirRaid* raid_meta, glm::vec3& center)
|
||||
{
|
||||
glm::vec3 dir = GlmHelper::UP;
|
||||
GlmHelper::RotateY(dir, a8::RandAngle());
|
||||
float rnd_rad = rand() % std::max(room_->GetGasData().new_area_meta->rad(), 100);
|
||||
glm::vec2 v2_center = room_->GetGasData().pos_new + glm::vec2(dir.x, dir.z) * (100.f + rnd_rad);
|
||||
center = glm::vec3(v2_center.x, 0.0f, v2_center.y);
|
||||
if (!room_->RandomSafeAreaPoint(center)) {
|
||||
return false;
|
||||
}
|
||||
{
|
||||
std::vector<Player*> humans;
|
||||
room_->GetAlivePlayers(humans, room_->GetRoomMaxPlayerNum());
|
||||
@ -79,6 +77,8 @@ bool AirRaid::GenAirRaidPos(const mt::AirRaid* raid_meta, glm::vec3& center)
|
||||
std::random_shuffle(humans.begin(), humans.end());
|
||||
for (Human* hum : humans) {
|
||||
if (!hum->poisoning) {
|
||||
glm::vec3 dir = GlmHelper::UP;
|
||||
GlmHelper::RotateY(dir, a8::RandAngle());
|
||||
center = hum->GetPos().ToGlmVec3() + dir * (float)(200 + rand() % 500);
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user