From 09708809109ba2c1db20075ed339ece887839c35 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 11 May 2021 00:21:48 -0400 Subject: [PATCH] whitespace fixes --- data/lua/core/interface.lua | 2 +- data/lua/core/mathx.lua | 2 +- data/lua/core/sides.lua | 2 +- data/lua/core/wml.lua | 10 +++++----- src/scripting/game_lua_kernel.cpp | 4 ++-- src/scripting/lua_audio.cpp | 14 +++++++------- src/scripting/lua_unit_attacks.cpp | 2 +- src/scripting/mapgen_lua_kernel.cpp | 2 +- src/soundsource.hpp | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/data/lua/core/interface.lua b/data/lua/core/interface.lua index cae02808af0..38b7c09e32f 100644 --- a/data/lua/core/interface.lua +++ b/data/lua/core/interface.lua @@ -56,4 +56,4 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then -- No deprecation for these since since they're not actually public API yet wesnoth.set_menu_item = wesnoth.interface.set_menu_item wesnoth.clear_menu_item = wesnoth.interface.clear_menu_item -end \ No newline at end of file +end diff --git a/data/lua/core/mathx.lua b/data/lua/core/mathx.lua index 5ee5e5bee17..84eb3b052e5 100644 --- a/data/lua/core/mathx.lua +++ b/data/lua/core/mathx.lua @@ -95,4 +95,4 @@ function mathx.shuffle(t, random_func) end end -mathx.random = wesnoth.deprecate_api('mathx.random', 'mathx.random', 1, nil, mathx.random) \ No newline at end of file +mathx.random = wesnoth.deprecate_api('mathx.random', 'mathx.random', 1, nil, mathx.random) diff --git a/data/lua/core/sides.lua b/data/lua/core/sides.lua index 5c4fd4282a2..91d6f771b28 100644 --- a/data/lua/core/sides.lua +++ b/data/lua/core/sides.lua @@ -45,4 +45,4 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then wesnoth.get_sides = wesnoth.deprecate_api('wesnoth.get_sides', 'wesnoth.sides.find', 1, nil, wesnoth.sides.find) wesnoth.create_side = wesnoth.deprecate_api('wesnoth.create_side', 'wesnoth.sides.create', 1, nil, wesnoth.sides.create) wesnoth.modify_ai = wesnoth.deprecate_api('wesnoth.modify_ai', 'wesnoth.sides.add|delete|change_ai_component', 1, nil, wesnoth.modify_ai) -end \ No newline at end of file +end diff --git a/data/lua/core/wml.lua b/data/lua/core/wml.lua index 26ae495fa36..af467afecec 100644 --- a/data/lua/core/wml.lua +++ b/data/lua/core/wml.lua @@ -366,7 +366,7 @@ if wesnoth.kernel_type() ~= "Application Lua Kernel" then wml.array_access.set(key, value) end }) - + --[========[Global persistent variables]========] local ns_key, global_temp = '$ns$', "lua_global_variable" local global_vars_ns = {} @@ -375,7 +375,7 @@ if wesnoth.kernel_type() ~= "Application Lua Kernel" then setmetatable({[ns_key] = namespace}, global_vars_ns) end } - + function global_vars_ns.__index(self, name) local U = wesnoth.require "wml-utils" local var = U.scoped_var(global_temp) @@ -393,7 +393,7 @@ if wesnoth.kernel_type() ~= "Application Lua Kernel" then end return res end - + function global_vars_ns.__newindex(self, name, val) local U = wesnoth.require "wml-utils" local var = U.scoped_var(global_temp) @@ -407,12 +407,12 @@ if wesnoth.kernel_type() ~= "Application Lua Kernel" then } end) end - + -- Make sure wesnoth.experimental.wml actually exists -- It's done this way so it doesn't break if we later need to add things here from C++ wesnoth.experimental = wesnoth.experimental or {} wesnoth.experimental.wml = wesnoth.experimental.wml or {} - + wesnoth.experimental.wml.global_vars = setmetatable({}, global_vars_mt) else --[========[Backwards compatibility for wml.tovconfig]========] diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index 2ded12bf98d..9292e06acdd 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -1248,7 +1248,7 @@ int game_lua_kernel::impl_scenario_get(lua_State *L) lua_push(L, mods); return 1; } - + if(classification.is_multiplayer()) { return_cfgref_attrib("mp_settings", play_controller_.get_mp_settings().to_config()); return_cfgref_attrib("era", find_addon("era", classification.era_id)); @@ -4387,7 +4387,7 @@ game_lua_kernel::game_lua_kernel(game_state & gs, play_controller & pc, reports lua_setmetatable(L, -2); lua_setfield(L, -2, "game_display"); lua_pop(L, 1); - + // Create the scenario table. cmd_log_ << "Adding scenario table...\n"; diff --git a/src/scripting/lua_audio.cpp b/src/scripting/lua_audio.cpp index 9d0610dffa7..a4743536a58 100644 --- a/src/scripting/lua_audio.cpp +++ b/src/scripting/lua_audio.cpp @@ -394,7 +394,7 @@ static int impl_source_get(lua_State* L) { return_bool_attrib("check_fogged", src->check_fogged()); return_bool_attrib("check_shrouded", src->check_shrouded()); return_cfg_attrib("__cfg", src->write(cfg)); - + if(strcmp(m, "locations") == 0) { const auto& locs = src->get_locations(); lua_createtable(L, locs.size(), 0); @@ -417,7 +417,7 @@ static int impl_source_set(lua_State* L) { modify_int_attrib("fade_range", src->set_fade_range(value)); modify_bool_attrib("check_fogged", src->set_check_fogged(value)); modify_bool_attrib("check_shrouded", src->set_check_shrouded(value)); - + if(strcmp(m, "sounds") == 0) { std::string files; if(lua_istable(L, 3)) { @@ -427,12 +427,12 @@ static int impl_source_set(lua_State* L) { } src->set_files(files); } - + if(strcmp(m, "locations") == 0) { std::vector locs; locs.resize(1); if(luaW_tolocation(L, 3, locs[0])) { - + } else { locs.clear(); for(lua_pushnil(L); lua_next(L, 3); lua_pop(L, 1)) { @@ -441,7 +441,7 @@ static int impl_source_set(lua_State* L) { } src->set_locations(locs); } - + // Now apply the change resources::soundsources->add(*src); resources::soundsources->update(); @@ -516,7 +516,7 @@ namespace lua_audio { }; luaL_setfuncs(L, vol_callbacks, 0); lua_setmetatable(L, -2); - + // The music playlist metatable lua_newuserdatauv(L, 0, 0); lua_createtable(L, 0, 10); @@ -537,7 +537,7 @@ namespace lua_audio { lua_setfield(L, -2, "__metatable"); lua_setmetatable(L, -2); lua_setfield(L, -2, "music_list"); - + // The sound source map metatable lua_newuserdatauv(L, 0, 0); lua_createtable(L, 0, 3); diff --git a/src/scripting/lua_unit_attacks.cpp b/src/scripting/lua_unit_attacks.cpp index 72485798a5a..269888193a6 100644 --- a/src/scripting/lua_unit_attacks.cpp +++ b/src/scripting/lua_unit_attacks.cpp @@ -389,7 +389,7 @@ namespace lua_units { lua_setfield(L, -2, "__metatable"); lua_pushcfunction(L, impl_unit_attack_match); lua_setfield(L, -2, "matches"); - + return cmd_out.str(); } } diff --git a/src/scripting/mapgen_lua_kernel.cpp b/src/scripting/mapgen_lua_kernel.cpp index c15fea2b1d9..f2fa446d18c 100644 --- a/src/scripting/mapgen_lua_kernel.cpp +++ b/src/scripting/mapgen_lua_kernel.cpp @@ -248,7 +248,7 @@ mapgen_lua_kernel::mapgen_lua_kernel(const config* vars) luaL_setfuncs(L, map_callbacks, 0); lua_pop(L, 1); assert(lua_gettop(L) == 0); - + // Add functions to the WML module lua_getglobal(L, "wml"); static luaL_Reg const wml_callbacks[] { diff --git a/src/soundsource.hpp b/src/soundsource.hpp index a07b68d0980..ace01983279 100644 --- a/src/soundsource.hpp +++ b/src/soundsource.hpp @@ -204,7 +204,7 @@ public: const std::string& id() const { return id_; } const std::string& files() const { return files_; } - + void set_files(const std::string& f) { files_ = f; }