diff --git a/src/scripting/lua_terrainfilter.cpp b/src/scripting/lua_terrainfilter.cpp index 186485855207..fd55311e5258 100644 --- a/src/scripting/lua_terrainfilter.cpp +++ b/src/scripting/lua_terrainfilter.cpp @@ -790,7 +790,7 @@ static lua_mapgen::filter* luaW_push_mgfilter(lua_State *L, T&&... params) /** * Create a filter. */ -int intf_terainfilter_create(lua_State *L) +int intf_terrainfilter_create(lua_State *L) { try { int res_index = 0; @@ -816,7 +816,7 @@ int intf_terainfilter_create(lua_State *L) * - Arg 2: string containing the name of the property. * - Ret 1: something containing the attribute. */ -static int impl_terainfilter_get(lua_State *L) +static int impl_terrainfilter_get(lua_State *L) { lua_mapgen::filter& f = luaW_check_mgfilter(L, 1); UNUSED(f); @@ -829,7 +829,7 @@ static int impl_terainfilter_get(lua_State *L) * - Arg 2: string containing the name of the property. * - Arg 3: something containing the attribute. */ -static int impl_terainfilter_set(lua_State *L) +static int impl_terrainfilter_set(lua_State *L) { lua_mapgen::filter& f = luaW_check_mgfilter(L, 1); UNUSED(f); @@ -852,7 +852,7 @@ static int intf_clearcache(lua_State *L) /** * Destroys a map object before it is collected (__gc metamethod). */ -static int impl_terainfilter_collect(lua_State *L) +static int impl_terrainfilter_collect(lua_State *L) { lua_mapgen::filter& f = luaW_check_mgfilter(L, 1); f.~filter(); @@ -868,15 +868,15 @@ namespace lua_terrainfilter { cmd_out << "Adding terrainmamap metatable...\n"; luaL_newmetatable(L, terrinfilterKey); - lua_pushcfunction(L, impl_terainfilter_collect); + lua_pushcfunction(L, impl_terrainfilter_collect); lua_setfield(L, -2, "__gc"); - lua_pushcfunction(L, impl_terainfilter_get); + lua_pushcfunction(L, impl_terrainfilter_get); lua_setfield(L, -2, "__index"); - lua_pushcfunction(L, impl_terainfilter_set); + lua_pushcfunction(L, impl_terrainfilter_set); lua_setfield(L, -2, "__newindex"); lua_pushstring(L, "terrain_filter"); lua_setfield(L, -2, "__metatable"); - // terainmap methods + // terrainmap methods lua_pushcfunction(L, intf_clearcache); lua_setfield(L, -2, "clear_cache"); diff --git a/src/scripting/lua_terrainfilter.hpp b/src/scripting/lua_terrainfilter.hpp index 9f21d1a7f6d8..d42dfd5b7dda 100644 --- a/src/scripting/lua_terrainfilter.hpp +++ b/src/scripting/lua_terrainfilter.hpp @@ -63,7 +63,7 @@ lua_mapgen::filter& luaW_check_mgfilter(lua_State *L, int index); void lua_mgfilter_setmetatable(lua_State *L); -int intf_terainfilter_create(lua_State *L); +int intf_terrainfilter_create(lua_State *L); int intf_mg_get_locations(lua_State* L); int intf_mg_get_tiles_radius(lua_State* L); diff --git a/src/scripting/lua_terrainmap.cpp b/src/scripting/lua_terrainmap.cpp index 23d4650b9c17..804e21128d3b 100644 --- a/src/scripting/lua_terrainmap.cpp +++ b/src/scripting/lua_terrainmap.cpp @@ -30,7 +30,7 @@ static lg::log_domain log_scripting_lua("scripting/lua"); #define LOG_LUA LOG_STREAM(info, log_scripting_lua) #define ERR_LUA LOG_STREAM(err, log_scripting_lua) -static const char terrinmapKey[] = "terrainmap"; +static const char terrainmapKey[] = "terrainmap"; static const char maplocationKey[] = "special_locations"; using std::string_view; @@ -92,8 +92,8 @@ int impl_slocs_get(lua_State* L) //todo: calling map.special_locations[1] will return the underlying map // object instead of the first starting position, because the lua // special locations is actually a table with the map object at - // index 1. The probably easiest way to fix this inconsitency is - // to just disallow all integerindicies here. + // index 1. The probably easiest way to fix this inconsistency is + // to just disallow all integer indices here. mapgen_gamemap& m = luaW_check_slocs(L, 1); string_view id = luaL_checkstring(L, 2); auto res = m.special_location(std::string(id)); @@ -193,7 +193,7 @@ map_location mapgen_gamemap::special_location(const std::string& id) const bool luaW_isterrainmap(lua_State* L, int index) { - return luaL_testudata(L, index, terrinmapKey) != nullptr; + return luaL_testudata(L, index, terrainmapKey) != nullptr; } @@ -216,7 +216,7 @@ mapgen_gamemap& luaW_checkterrainmap(lua_State *L, int index) void lua_terrainmap_setmetatable(lua_State *L) { - luaL_setmetatable(L, terrinmapKey); + luaL_setmetatable(L, terrainmapKey); } template @@ -229,13 +229,13 @@ mapgen_gamemap* luaW_pushmap(lua_State *L, T&&... params) /** * Create a map. - * - Arg 1: string descripbing the map data. + * - Arg 1: string describing the map data. * - or: * - Arg 1: int, width * - Arg 2: int, height * - Arg 3: string, terrain */ -int intf_terainmap_create(lua_State *L) +int intf_terrainmap_create(lua_State *L) { if(lua_isnumber(L, 1) && lua_isnumber(L, 2)) { int w = lua_tonumber(L, 1); @@ -254,7 +254,7 @@ int intf_terainmap_create(lua_State *L) /** * Destroys a map object before it is collected (__gc metamethod). */ -static int impl_terainmap_collect(lua_State *L) +static int impl_terrainmap_collect(lua_State *L) { mapgen_gamemap *u = static_cast(lua_touserdata(L, 1)); u->mapgen_gamemap::~mapgen_gamemap(); @@ -267,7 +267,7 @@ static int impl_terainmap_collect(lua_State *L) * - Arg 2: string containing the name of the property. * - Ret 1: something containing the attribute. */ -static int impl_terainmap_get(lua_State *L) +static int impl_terrainmap_get(lua_State *L) { mapgen_gamemap& tm = luaW_checkterrainmap(L, 1); char const *m = luaL_checkstring(L, 2); @@ -293,7 +293,7 @@ static int impl_terainmap_get(lua_State *L) * - Arg 2: string containing the name of the property. * - Arg 3: something containing the attribute. */ -static int impl_terainmap_set(lua_State *L) +static int impl_terrainmap_set(lua_State *L) { mapgen_gamemap& tm = luaW_checkterrainmap(L, 1); UNUSED(tm); @@ -397,11 +397,11 @@ static std::vector read_rules_vector(lua_State *L, int in return rules; } /** - * Reaplces part of the map. + * Replaces part of the map. * - Arg 1: map location. * - Arg 2: map data string. * - Arg 3: table for optional named arguments - * - is_odd: boolen, if Arg2 has the odd mapo format (as if it was cut from a odd map location) + * - is_odd: boolean, if Arg2 has the odd map format (as if it was cut from a odd map location) * - ignore_special_locations: boolean * - rules: table of tables */ @@ -448,18 +448,18 @@ namespace lua_terrainmap { { std::ostringstream cmd_out; - cmd_out << "Adding terrainmamap metatable...\n"; + cmd_out << "Adding terrainmap metatable...\n"; - luaL_newmetatable(L, terrinmapKey); - lua_pushcfunction(L, impl_terainmap_collect); + luaL_newmetatable(L, terrainmapKey); + lua_pushcfunction(L, impl_terrainmap_collect); lua_setfield(L, -2, "__gc"); - lua_pushcfunction(L, impl_terainmap_get); + lua_pushcfunction(L, impl_terrainmap_get); lua_setfield(L, -2, "__index"); - lua_pushcfunction(L, impl_terainmap_set); + lua_pushcfunction(L, impl_terrainmap_set); lua_setfield(L, -2, "__newindex"); - lua_pushstring(L, "terainmap"); + lua_pushstring(L, "terrainmap"); lua_setfield(L, -2, "__metatable"); - // terainmap methods + // terrainmap methods lua_pushcfunction(L, intf_set_terrain); lua_setfield(L, -2, "set_terrain"); lua_pushcfunction(L, intf_get_terrain); @@ -471,7 +471,7 @@ namespace lua_terrainmap { lua_pushcfunction(L, &mapgen_gamemap::intf_mg_terrain_mask); lua_setfield(L, -2, "terrain_mask"); - cmd_out << "Adding terrainmamap2 metatable...\n"; + cmd_out << "Adding terrainmap2 metatable...\n"; luaL_newmetatable(L, maplocationKey); lua_pushcfunction(L, impl_slocs_get); diff --git a/src/scripting/lua_terrainmap.hpp b/src/scripting/lua_terrainmap.hpp index c7cd14dab45b..89cb3a6033ab 100644 --- a/src/scripting/lua_terrainmap.hpp +++ b/src/scripting/lua_terrainmap.hpp @@ -26,7 +26,7 @@ struct map_location; // this clas is similar to the orginal gamemap class but they have no 'is' rlation: // mapgen_gamemap, unlike gamemap offers 'raw' access to the data -// gamemap, unlike mapgen_gamemap uses terain type data. +// gamemap, unlike mapgen_gamemap uses terrain type data. class mapgen_gamemap { public: @@ -118,7 +118,7 @@ void lua_terrainmap_setmetatable(lua_State *L); mapgen_gamemap* luaW_pushmap(lua_State *L, mapgen_gamemap&& u); -int intf_terainmap_create(lua_State *L); +int intf_terrainmap_create(lua_State *L); namespace lua_terrainmap { std::string register_metatables(lua_State *L); diff --git a/src/scripting/mapgen_lua_kernel.cpp b/src/scripting/mapgen_lua_kernel.cpp index d1cc0b7a5844..87daaba75600 100644 --- a/src/scripting/mapgen_lua_kernel.cpp +++ b/src/scripting/mapgen_lua_kernel.cpp @@ -222,8 +222,8 @@ mapgen_lua_kernel::mapgen_lua_kernel(const config* vars) static luaL_Reg const callbacks[] { { "find_path", &intf_find_path }, { "random", &intf_random }, - { "create_filter", &intf_terainfilter_create }, - { "create_map", &intf_terainmap_create }, + { "create_filter", &intf_terrainfilter_create }, + { "create_map", &intf_terrainmap_create }, { "default_generate_height_map", &intf_default_generate_height_map }, { "generate_default_map", &intf_default_generate }, { "get_variable", &dispatch<&mapgen_lua_kernel::intf_get_variable> },