aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/defaultsettings.cpp1
-rw-r--r--src/serverremoteplayer.cpp6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index be63fb870..1e48183fa 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -94,6 +94,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("default_password", "");
settings->setDefault("default_privs", "build, shout");
settings->setDefault("unlimited_player_transfer_distance", "true");
+ settings->setDefault("enable_pvp", "true");
settings->setDefault("profiler_print_interval", "0");
settings->setDefault("enable_mapgen_debug_info", "false");
diff --git a/src/serverremoteplayer.cpp b/src/serverremoteplayer.cpp
index bff414e1a..900cc5432 100644
--- a/src/serverremoteplayer.cpp
+++ b/src/serverremoteplayer.cpp
@@ -139,6 +139,12 @@ void ServerRemotePlayer::punch(ServerActiveObject *puncher,
if(!puncher)
return;
+ // No effect if PvP disabled
+ if(g_settings->getBool("enable_pvp") == false){
+ if(puncher->getType() == ACTIVEOBJECT_TYPE_PLAYER)
+ return;
+ }
+
// "Material" properties of a player
MaterialProperties mp;
mp.diggability = DIGGABLE_NORMAL;