summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2015-08-31 11:23:34 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2015-08-31 11:23:34 +0100
commitd069046c2ea1905237791b81b6e0a8f3ecb66d33 (patch)
tree95bdd736c279bf13ba8d8398a8432a9733be36fb
parentba35657b0c36c7b4f386333e21e54d653af401af (diff)
Tweaked and tidied code
-rw-r--r--init.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/init.lua b/init.lua
index a84d9a5..b279a24 100644
--- a/init.lua
+++ b/init.lua
@@ -6,7 +6,7 @@ local statspawn = (minetest.setting_get_pos("static_spawnpoint") or {x = 0, y =
protector = {}
protector.mod = "redo"
protector.radius = (tonumber(minetest.setting_get("protector_radius")) or 5)
-protector.pvp = minetest.setting_get("protector_pvp") or false
+protector.pvp = minetest.setting_getbool("protector_pvp")
protector.spawn = (tonumber(minetest.setting_get("protector_pvp_spawn")) or 0)
protector.get_member_list = function(meta)
@@ -708,7 +708,7 @@ minetest.register_craft({
})
-- Disable PVP in your own protected areas
-if minetest.setting_getbool("enable_pvp") and protector.pvp == "true" then
+if minetest.setting_getbool("enable_pvp") and protector.pvp then
if minetest.register_on_punchplayer then
@@ -716,7 +716,7 @@ if minetest.setting_getbool("enable_pvp") and protector.pvp == "true" then
function(player, hitter, time_from_last_punch, tool_capabilities, dir, damage)
if not player or not hitter then
- print("on_punchplayer called with nil objects")
+ print("[Protector] on_punchplayer called with nil objects")
end
if not hitter:is_player() then
@@ -742,9 +742,11 @@ if minetest.setting_getbool("enable_pvp") and protector.pvp == "true" then
end)
else
- print("PVP protection not active, update your version of Minetest")
+ print("[Protector] pvp_protect not active, update your version of Minetest")
end
else
- print("PVP is disabled in world")
-end \ No newline at end of file
+ print("[Protector] pvp_protect is disabled")
+end
+
+print ("[MOD] Protector loaded") \ No newline at end of file