This commit is contained in:
aozhiwei 2024-08-29 19:29:42 +08:00
parent e1c92ba5a9
commit b5d13dcb6c

View File

@ -1,5 +1,7 @@
#include "precompile.h"
#include <random>
#include "incubator.h"
#include "room.h"
#include "human.h"
@ -686,6 +688,9 @@ void Incubator::StartNewBattleMode()
(
[this, selected_player, &invisable_humans, &invisable_teammates] (Human* hum) -> bool
{
if (hum == selected_player) {
return true;
}
if (!CanSee(hum, selected_player)) {
if (hum->GetTeam() == selected_player->GetTeam()) {
invisable_teammates.push_back(hum);
@ -696,7 +701,10 @@ void Incubator::StartNewBattleMode()
return true;
});
if (invisable_humans.size() > 0) {
std::shuffle(invisable_humans.begin(),
invisable_humans.end(),
std::default_random_engine(a8::XGetTickCount()));
Human *target = invisable_humans.at(0);
}
}
},