mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
test mobs
This commit is contained in:
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue