Skip to content

Commit

Permalink
Fix a typo
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Feb 15, 2021
1 parent 3671d3a commit a5ae159
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
16 changes: 8 additions & 8 deletions src/scripting/lua_terrainfilter.cpp
Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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();
Expand All @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion src/scripting/lua_terrainfilter.hpp
Expand Up @@ -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);
Expand Down
18 changes: 9 additions & 9 deletions src/scripting/lua_terrainmap.cpp
Expand Up @@ -235,7 +235,7 @@ mapgen_gamemap* luaW_pushmap(lua_State *L, T&&... params)
* - 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);
Expand All @@ -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<mapgen_gamemap*>(lua_touserdata(L, 1));
u->mapgen_gamemap::~mapgen_gamemap();
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -451,15 +451,15 @@ namespace lua_terrainmap {
cmd_out << "Adding terrainmamap metatable...\n";

luaL_newmetatable(L, terrinmapKey);
lua_pushcfunction(L, impl_terainmap_collect);
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);
Expand Down
4 changes: 2 additions & 2 deletions src/scripting/lua_terrainmap.hpp
Expand Up @@ -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:
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/scripting/mapgen_lua_kernel.cpp
Expand Up @@ -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> },
Expand Down

0 comments on commit a5ae159

Please sign in to comment.