test mobs

This commit is contained in:
MihailRis
2025-09-01 01:39:31 +03:00
parent c06636053d
commit 88641e032a
5 changed files with 142 additions and 79 deletions
@@ -49,7 +49,7 @@ static int l_make_route(lua::State* L) {
auto start = lua::tovec3(L, 2);
auto target = lua::tovec3(L, 3);
agent->state = {};
agent->start = start;
agent->start = glm::floor(start);
agent->target = target;
auto route = level->pathfinding->perform(*agent);
if (!route.found) {
@@ -65,7 +65,7 @@ static int l_make_route_async(lua::State* L) {
auto start = lua::tovec3(L, 2);
auto target = lua::tovec3(L, 3);
agent->state = {};
agent->start = start;
agent->start = glm::floor(start);
agent->target = target;
level->pathfinding->perform(*agent, 0);
}
@@ -78,7 +78,7 @@ static int l_pull_route(lua::State* L) {
if (!agent->state.finished) {
return 0;
}
if (!route.found) {
if (!route.found && !agent->mayBeIncomplete) {
return lua::createtable(L, 0, 0);
}
return push_route(L, route);