Remove memory allocation in pathfinding

This commit is contained in:
2023-12-07 10:42:53 +01:00
parent 0d156f515e
commit 9800b5576e
6 changed files with 19 additions and 15 deletions

View File

@@ -138,7 +138,8 @@ void updatePlayerInput() {
.target=target,
.map=map,
.outPath=&path,
.pool=game->pools.pathData
.pool=game->pools.pathData,
.alloc=&game->stackAlloc
});
if (!path.paths) continue;
ecs_set_ptr(ECS, entity, Path, &path);
@@ -166,7 +167,8 @@ void updatePlayerInput() {
.target=worldPos,
.map=map,
.outPath=&path,
.pool=game->pools.pathData
.pool=game->pools.pathData,
.alloc=&game->stackAlloc
});
if (!path.paths) continue;
ecs_set_ptr(ECS, entity, Path, &path);