1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-15 22:05:07 -05:00

Add enable_pvp setting

This commit is contained in:
Perttu Ahola 2011-12-02 11:25:47 +02:00
parent 34fd47887e
commit 9af0142a36
3 changed files with 9 additions and 0 deletions

View File

@ -133,6 +133,8 @@
#default_privs = build, shout #default_privs = build, shout
# Whether players are transferred to client without any range limit # Whether players are transferred to client without any range limit
#unlimited_player_transfer_distance = true #unlimited_player_transfer_distance = true
# Whether to enable players killing each other
#enable_pvp = true
# Profiler data print interval. #0 = disable. # Profiler data print interval. #0 = disable.
#profiler_print_interval = 0 #profiler_print_interval = 0

View File

@ -94,6 +94,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("default_password", ""); settings->setDefault("default_password", "");
settings->setDefault("default_privs", "build, shout"); settings->setDefault("default_privs", "build, shout");
settings->setDefault("unlimited_player_transfer_distance", "true"); settings->setDefault("unlimited_player_transfer_distance", "true");
settings->setDefault("enable_pvp", "true");
settings->setDefault("profiler_print_interval", "0"); settings->setDefault("profiler_print_interval", "0");
settings->setDefault("enable_mapgen_debug_info", "false"); settings->setDefault("enable_mapgen_debug_info", "false");

View File

@ -139,6 +139,12 @@ void ServerRemotePlayer::punch(ServerActiveObject *puncher,
if(!puncher) if(!puncher)
return; 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 // "Material" properties of a player
MaterialProperties mp; MaterialProperties mp;
mp.diggability = DIGGABLE_NORMAL; mp.diggability = DIGGABLE_NORMAL;