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)
|
bool AirRaid::GenAirRaidPos(const mt::AirRaid* raid_meta, glm::vec3& center)
|
||||||
{
|
{
|
||||||
glm::vec3 dir = GlmHelper::UP;
|
if (!room_->RandomSafeAreaPoint(center)) {
|
||||||
GlmHelper::RotateY(dir, a8::RandAngle());
|
return false;
|
||||||
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);
|
|
||||||
{
|
{
|
||||||
std::vector<Player*> humans;
|
std::vector<Player*> humans;
|
||||||
room_->GetAlivePlayers(humans, room_->GetRoomMaxPlayerNum());
|
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());
|
std::random_shuffle(humans.begin(), humans.end());
|
||||||
for (Human* hum : humans) {
|
for (Human* hum : humans) {
|
||||||
if (!hum->poisoning) {
|
if (!hum->poisoning) {
|
||||||
|
glm::vec3 dir = GlmHelper::UP;
|
||||||
|
GlmHelper::RotateY(dir, a8::RandAngle());
|
||||||
center = hum->GetPos().ToGlmVec3() + dir * (float)(200 + rand() % 500);
|
center = hum->GetPos().ToGlmVec3() + dir * (float)(200 + rand() % 500);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user