1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Pathfinder: Fix style

* Fix naming style for methods and classes:
	Use camelCase for methods and PascalCase for classes as
	code style demands it. And use sneak_case for methods that
	are not member of a class.
* Replace "* " with " *" for Pointers
* Same for references
* Put function body opening braces on new line
* Other misc minor non functional style improvements
This commit is contained in:
est31 2016-04-01 01:52:17 +02:00
parent 46e5ef4e9a
commit ac8bb457aa
3 changed files with 211 additions and 192 deletions

View file

@ -915,19 +915,19 @@ int ModApiEnvMod::l_find_path(lua_State *L)
unsigned int searchdistance = luaL_checkint(L, 3);
unsigned int max_jump = luaL_checkint(L, 4);
unsigned int max_drop = luaL_checkint(L, 5);
algorithm algo = A_PLAIN_NP;
PathAlgorithm algo = PA_PLAIN_NP;
if (!lua_isnil(L, 6)) {
std::string algorithm = luaL_checkstring(L,6);
if (algorithm == "A*")
algo = A_PLAIN;
algo = PA_PLAIN;
if (algorithm == "Dijkstra")
algo = DIJKSTRA;
algo = PA_DIJKSTRA;
}
std::vector<v3s16> path =
get_Path(env,pos1,pos2,searchdistance,max_jump,max_drop,algo);
std::vector<v3s16> path = get_path(env, pos1, pos2,
searchdistance, max_jump, max_drop, algo);
if (path.size() > 0)
{