mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
feat: async pathfinding
This commit is contained in:
parent
be3fb8346f
commit
a78931205f
7 changed files with 168 additions and 112 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include "objects/Player.hpp"
|
||||
#include "physics/Hitbox.hpp"
|
||||
#include "voxels/Chunks.hpp"
|
||||
#include "voxels/Pathfinding.hpp"
|
||||
#include "scripting/scripting.hpp"
|
||||
#include "lighting/Lighting.hpp"
|
||||
#include "settings.hpp"
|
||||
|
|
@ -69,6 +70,9 @@ LevelController::LevelController(
|
|||
}
|
||||
|
||||
void LevelController::update(float delta, bool pause) {
|
||||
level->pathfinding->performAllAsync(
|
||||
settings.pathfinding.stepsPerAsyncAgent.get()
|
||||
);
|
||||
for (const auto& [_, player] : *level->players) {
|
||||
if (player->isSuspended()) {
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue