Rationalizing the use of scan_radius and making it accessible
This commit is contained in:
@@ -228,7 +228,7 @@ void World::tangible_delete(int64_t id) {
|
||||
LS.result();
|
||||
}
|
||||
|
||||
util::IdVector World::get_near_unsorted(int64_t player_id, float radius, bool exclude_nowhere) const {
|
||||
util::IdVector World::get_near_unsorted(int64_t player_id, float radius, bool exclude_nowhere, bool omit_player) const {
|
||||
const Tangible *player = tangible_get(player_id);
|
||||
if (player == nullptr) {
|
||||
return IdVector();
|
||||
@@ -236,19 +236,18 @@ util::IdVector World::get_near_unsorted(int64_t player_id, float radius, bool ex
|
||||
|
||||
// Find out where's the center of the world.
|
||||
const AnimStep &aqback = player->anim_queue_.back();
|
||||
if (exclude_nowhere && (aqback.plane() == "nowhere")) {
|
||||
IdVector idv;
|
||||
idv.push_back(player_id);
|
||||
return idv;
|
||||
}
|
||||
|
||||
return plane_map_.scan_radius(aqback.plane(), aqback.xyz().x, aqback.xyz().y, radius, player_id);
|
||||
return plane_map_.scan_radius_unsorted(aqback.plane(), aqback.xyz().x, aqback.xyz().y, radius, exclude_nowhere, player_id, omit_player);
|
||||
}
|
||||
|
||||
util::IdVector World::get_near(int64_t player_id, float radius, bool exclude_nowhere) const {
|
||||
util::IdVector v = get_near_unsorted(player_id, radius, exclude_nowhere);
|
||||
std::sort(v.begin(), v.end());
|
||||
return v;
|
||||
util::IdVector World::get_near(int64_t player_id, float radius, bool exclude_nowhere, bool omit_player) const {
|
||||
const Tangible *player = tangible_get(player_id);
|
||||
if (player == nullptr) {
|
||||
return IdVector();
|
||||
}
|
||||
|
||||
// Find out where's the center of the world.
|
||||
const AnimStep &aqback = player->anim_queue_.back();
|
||||
return plane_map_.scan_radius(aqback.plane(), aqback.xyz().x, aqback.xyz().y, radius, exclude_nowhere, player_id, omit_player);
|
||||
}
|
||||
|
||||
World::Redirects World::fetch_redirects() {
|
||||
|
||||
Reference in New Issue
Block a user