add pathfinding.set_width

This commit is contained in:
MihailRis 2026-11-01 18:07:21 +03:00
parent 1fe64a8b51
commit b37da1a728
2 changed files with 8 additions and 1 deletions

View file

@ -100,6 +100,13 @@ static int l_set_jump_height(lua::State* L) {
return 0;
}
static int l_set_width(lua::State* L) {
if (auto agent = get_agent(L)) {
agent->width = lua::tonumber(L, 2);
}
return 0;
}
static int l_avoid_tag(lua::State* L) {
if (auto agent = get_agent(L)) {
int index =
@ -125,6 +132,7 @@ const luaL_Reg pathfindinglib[] = {
{"pull_route", lua::wrap<l_pull_route>},
{"set_max_visited", lua::wrap<l_set_max_visited_blocks>},
{"set_jump_height", lua::wrap<l_set_jump_height>},
{"set_width", lua::wrap<l_set_width>},
{"avoid_tag", lua::wrap<l_avoid_tag>},
{nullptr, nullptr}
};

View file

@ -7,7 +7,6 @@
#include "voxels/Chunk.hpp"
#include "voxels/GlobalChunks.hpp"
#include "world/Level.hpp"
#include "debug/debug.hpp"
#include <algorithm>
#include <cmath>