And finally fix some of the API names to make more sense in their current location.
This commit is contained in:
parent
a20d701096
commit
7ffa6025ce
11 changed files with 74 additions and 99 deletions
|
@ -9,7 +9,7 @@ int number_left() {
|
|||
|
||||
GameDB::current_world()->query<components::Position, Comp>(
|
||||
[&](const auto ent, auto&, auto&) {
|
||||
if(ent != GameDB::current().player) {
|
||||
if(ent != GameDB::current_level().player) {
|
||||
count++;
|
||||
}
|
||||
});
|
||||
|
@ -19,15 +19,15 @@ int number_left() {
|
|||
|
||||
template<typename Comp>
|
||||
Pathing compute_paths() {
|
||||
auto& walls_original = GameDB::current().map->$walls;
|
||||
auto& walls_original = GameDB::current_level().map->$walls;
|
||||
auto walls_copy = walls_original;
|
||||
|
||||
Pathing paths{matrix::width(walls_copy), matrix::height(walls_copy)};
|
||||
|
||||
GameDB::current().world->query<components::Position>(
|
||||
GameDB::current_level().world->query<components::Position>(
|
||||
[&](const auto ent, auto& position) {
|
||||
if(ent != GameDB::current().player) {
|
||||
if(GameDB::current().world->has<Comp>(ent)) {
|
||||
if(ent != GameDB::current_level().player) {
|
||||
if(GameDB::current_level().world->has<Comp>(ent)) {
|
||||
paths.set_target(position.location);
|
||||
} else {
|
||||
// this will mark that spot as a wall so we don't path there temporarily
|
||||
|
@ -110,7 +110,7 @@ bool Autowalker::path_player(Pathing& paths, Point& target_out) {
|
|||
}
|
||||
}
|
||||
|
||||
if(!GameDB::current().map->can_move(target_out)) {
|
||||
if(!GameDB::current_level().map->can_move(target_out)) {
|
||||
path_fail(paths.$paths, target_out);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue