Skip to content

Commit a0cb201

Browse files
committed
Fix /area_pvp with PvP by default setting
I think this was based on a misunderstanding on what PvP by default was meant to do, and I forgot to remove it.
1 parent 3ee0566 commit a0cb201

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

chatcommands.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,8 @@ minetest.register_chatcommand("area_pvp", {
521521
end
522522
end
523523

524-
if areas.config.pvp_by_default == not canPvP then
525-
-- Save the default value as nil to avoid inflating the DB.
526-
areas.areas[id].canPvP = nil
527-
else
528-
areas.areas[id].canPvP = not canPvP
529-
end
524+
-- Save false as nil to avoid inflating the DB.
525+
areas.areas[id].canPvP = (not canPvP) or nil
530526
areas:save()
531527
return true, S("PvP is @1 in area @2.",
532528
not canPvP and S("enabled") or S("disabled"), id)

0 commit comments

Comments
 (0)