diff --git a/.luacheckrc b/.luacheckrc index 47acdd7b5..f8bd0a36f 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -72,9 +72,6 @@ read_globals = { exclude_files = { -- External mods: - -- пришлось добавить после того, как обновился LuaRocks: - "mods/lord/Game/lord_base_commands/chatcommands.lua", - -- MTG: "mods/_minetest_game/", diff --git a/mods/lord/Entities/lottmobs/warg.lua b/mods/lord/Entities/lottmobs/warg.lua index 7764cae53..24b978d4e 100644 --- a/mods/lord/Entities/lottmobs/warg.lua +++ b/mods/lord/Entities/lottmobs/warg.lua @@ -41,7 +41,7 @@ lottmobs.register_horse("lottmobs:warg_mount", { mobs:register_mob("lottmobs:warg", { -- type = "npc", type = "monster", - race = "GAMEorc", + race = "orc", hp_min = 25, hp_max = 40, collisionbox = { -0.6, -0.1, -0.6, 0.6, 1.5, 0.6 }, diff --git a/mods/lord/Game/lord_base_commands/chatcommands.lua b/mods/lord/Game/lord_base_commands/chatcommands.lua deleted file mode 100644 index 500e2bc03..000000000 --- a/mods/lord/Game/lord_base_commands/chatcommands.lua +++ /dev/null @@ -1,199 +0,0 @@ ---Modified from builtin/game/chatcommands.lua to hide privs starting with GAME - -minetest.register_chatcommand("privs", { - params = "", - description = "print out privileges of player", - func = function(name, param) - param = (param ~= "" and param or name) - local privs_table = minetest.get_player_privs(param) - local privs = "" - local i = 1 - for key,value in pairs(privs_table) do - if key:match("GAME", 1) then - key, value = nil - elseif i == 1 then - privs = privs .. key - i = i + 1 - else - privs = privs .. ", " .. key - i = i + 1 - end - end - return true, "Privileges of " .. param .. ": " .. privs - end, -}) - -minetest.register_chatcommand("grant", { - params = " |all", - description = "Give privilege to player", - func = function(name, param) - if not minetest.check_player_privs(name, {privs=true}) and - not minetest.check_player_privs(name, {basic_privs=true}) then - return false, "Your privileges are insufficient." - end - local grant_name, grantprivstr = string.match(param, "([^ ]+) (.+)") - if not grant_name or not grantprivstr then - return false, "Invalid parameters (see /help grant)" - elseif not minetest.player_exists(grant_name) then - return false, "Player " .. grant_name .. " does not exist." - end - local grantprivs = minetest.string_to_privs(grantprivstr) - if grantprivstr == "all" then - grantprivs = minetest.registered_privileges - end - local privs = minetest.get_player_privs(grant_name) - local privs_unknown = "" - for priv, _ in pairs(grantprivs) do - if priv ~= "interact" and priv ~= "shout" and - not minetest.check_player_privs(name, {privs=true}) then - return false, "Your privileges are insufficient." - end - if not minetest.registered_privileges[priv] then - privs_unknown = privs_unknown .. "Unknown privilege: " .. priv .. "\n" - end - if not priv:match("GAME", 1) then - privs[priv] = true - end - end - if privs_unknown ~= "" then - return false, privs_unknown - end - minetest.set_player_privs(grant_name, privs) - local privs_table = minetest.get_player_privs(grant_name) - local privs_string = "" - local i = 1 - for key,value in pairs(privs_table) do - if key:match("GAME", 1) then - key, value = nil - elseif i == 1 then - privs_string = privs_string .. key - i = i + 1 - else - privs_string = privs_string .. ", " .. key - i = i + 1 - end - end - minetest.log("action", name..' granted ' .. privs_string .. ' privileges to '.. grant_name) - if grant_name ~= name then - minetest.chat_send_player(grant_name, name - .. " granted you privileges: " - .. privs_string) - end - return true, "Privileges of " .. grant_name .. ": " .. privs_string - end, -}) - -minetest.register_chatcommand("grantme", { - params = "|all", - description = "Give privilege to yourself", - func = function(name, param) - if not minetest.check_player_privs(name, {privs=true}) and - not minetest.check_player_privs(name, {basic_privs=true}) then - return false, "Your privileges are insufficient." - end - if not param then - return false, "Invalid parameters (see /help grant)" - end - local grantprivs = minetest.string_to_privs(param) - if param == "all" then - grantprivs = minetest.registered_privileges - end - local privs = minetest.get_player_privs(name) - local privs_unknown = "" - for priv, _ in pairs(grantprivs) do - if priv ~= "interact" and priv ~= "shout" and - not minetest.check_player_privs(name, {privs=true}) then - return false, "Your privileges are insufficient." - end - if not minetest.registered_privileges[priv] then - privs_unknown = privs_unknown .. "Unknown privilege: " .. priv .. "\n" - end - if not priv:match("GAME", 1) then - privs[priv] = true - end - end - if privs_unknown ~= "" then - return false, privs_unknown - end - minetest.set_player_privs(name, privs) - local privs_table = minetest.get_player_privs(name) - local privs_string = "" - local i = 1 - for key,value in pairs(privs_table) do - if key:match("GAME", 1) then - key, value = nil - elseif i == 1 then - privs_string = privs_string .. key - i = i + 1 - else - privs_string = privs_string .. ", " .. key - i = i + 1 - end - end - minetest.log("action", name ..' granted ' .. privs_string .. ' privileges to him/herself') - return true, "Privileges of " .. name .. ": " .. privs_string - end, -}) - -minetest.register_chatcommand("revoke", { - params = " |all", - description = "Remove privilege from player", - privs = {}, - func = function(name, param) - if not minetest.check_player_privs(name, {privs=true}) and - not minetest.check_player_privs(name, {basic_privs=true}) then - return false, "Your privileges are insufficient." - end - local revoke_name, revoke_priv_str = string.match(param, "([^ ]+) (.+)") - if not revoke_name or not revoke_priv_str then - return false, "Invalid parameters (see /help revoke)" - elseif not minetest.player_exists(revoke_name) then - return false, "Player " .. revoke_name .. " does not exist." - end - local revoke_privs = minetest.string_to_privs(revoke_priv_str) - local privs = minetest.get_player_privs(revoke_name) - for priv, _ in pairs(revoke_privs) do - if priv ~= "interact" and priv ~= "shout" and - not minetest.check_player_privs(name, {privs=true}) then - return false, "Your privileges are insufficient." - end - end - if revoke_priv_str == "all" then - for priv, _ in pairs(privs) do - if priv:find("GAME", 1) == nil then - privs[priv] = nil - end - end - else - for priv, _ in pairs(revoke_privs) do - if priv:find("GAME", 1) == nil then - privs[priv] = nil - end - end - end - minetest.set_player_privs(revoke_name, privs) - local privs_table = minetest.get_player_privs(revoke_name) - local privs_string = "" - local i = 1 - for key,value in pairs(privs_table) do - if key:match("GAME", 1) then - key, value = nil - elseif i == 1 then - privs_string = privs_string .. key - i = i + 1 - else - privs_string = privs_string .. ", " .. key - i = i + 1 - end - end - minetest.log("action", name..' revoked (' - .. privs_string - ..') privileges from '..revoke_name) - if revoke_name ~= name then - minetest.chat_send_player(revoke_name, name - .. " revoked privileges from you: " - .. privs_string) - end - return true, "Privileges of " .. revoke_name .. ": " .. privs_string - end, -}) diff --git a/mods/lord/Game/lord_base_commands/init.lua b/mods/lord/Game/lord_base_commands/init.lua deleted file mode 100644 index 269b1e65c..000000000 --- a/mods/lord/Game/lord_base_commands/init.lua +++ /dev/null @@ -1,3 +0,0 @@ - --- Эти команды были переопределены в изначальном LOTT, подключались в их `default`-мод, который они скопировали из MTG -dofile(minetest.get_modpath(minetest.get_current_modname()).."/chatcommands.lua") diff --git a/mods/lord/Game/lord_base_commands/mod.conf b/mods/lord/Game/lord_base_commands/mod.conf deleted file mode 100644 index dfe8c0c3e..000000000 --- a/mods/lord/Game/lord_base_commands/mod.conf +++ /dev/null @@ -1,2 +0,0 @@ -name = lord_base_commands -depends = lordlib diff --git a/mods/lord/readme.md b/mods/lord/readme.md index 398c4b307..aabf54ffe 100644 --- a/mods/lord/readme.md +++ b/mods/lord/readme.md @@ -47,13 +47,6 @@ ### `legacy` - вынесено из LOTT/`mods/default/`[legacy.lua](https://github.com/minetest-LOTR/Lord-of-the-Test/blob/master/mods/default/legacy.lua) -### `lord_base_commands` - - только перевод. (команд) - -### `lord_base_privs` - - регистрация базовых привилегий - - < наш или откуда-то взят ??? > - ### `lord_classes` - доработки и переделки из [lottclasses](https://github.com/minetest-LOTR/Lord-of-the-Test/tree/master/mods/lottclasses) - все скины здесь