1
This commit is contained in:
parent
5806ccc629
commit
c97f7ab12c
@ -889,16 +889,14 @@ Human* Room::GetWatchWarTarget(Human* hum)
|
||||
target = players[rand() % players.size()];
|
||||
} else if (!humans.empty()) {
|
||||
target = humans[rand() % humans.size()];
|
||||
#ifdef DEBUG
|
||||
#ifdef DEBUG1
|
||||
{
|
||||
target = humans[0];
|
||||
for (auto h : humans) {
|
||||
if (target != h) {
|
||||
if (target->GetPos().Distance(hum->GetPos()) > h->GetPos().Distance(hum->GetPos())) {
|
||||
target = h;
|
||||
}
|
||||
}
|
||||
}
|
||||
std::sort(humans.begin(), humans.end(),
|
||||
[hum] (Human* a, Human *b) -> bool
|
||||
{
|
||||
return (hum->GetPos()-a->GetPos()).Norm() < (hum->GetPos()-b->GetPos()).Norm();
|
||||
});
|
||||
target = humans[rand() % std::min(humans.size(), (size_t)3)];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user