Code: Select all
Index: src/Commands.pm
===================================================================
--- src/Commands.pm	(revision 6342)
+++ src/Commands.pm	(working copy)
@@ -76,6 +76,7 @@
 	cl                 => \&cmdChatLogClear,
 	closeshop          => \&cmdCloseShop,
 	conf               => \&cmdConf,
+	unconf             => \&cmdUnconf,
 	damage             => \&cmdDamage,
 	deal               => \&cmdDeal,
 	debug              => \&cmdDebug,
@@ -1063,6 +1064,22 @@
 	main::closeShop();
 }
 
+sub cmdUnconf {
+	my (undef, $args) = @_;
+	my ($arg1) = $args =~ /^(\w*\.*\w+)/;
+
+	if (exists $config{$arg1}) {
+		Plugins::callHook('Commands::cmdConf', {
+			key => $arg1,
+			val => ''
+		});
+		configModify($arg1, '');
+		Log::initLogFiles();
+	} else {
+		error TF("Config variable %s doesn't exist\n", $arg1);
+	}
+}
+
 sub cmdConf {
 	my (undef, $args) = @_;
 	my ($arg1) = $args =~ /^(\w*\.*\w+)/;
Index: src/Misc.pm
===================================================================
--- src/Misc.pm	(revision 6342)
+++ src/Misc.pm	(working copy)
@@ -289,7 +289,13 @@
 
 	if (!$args{silent} && $key !~ /password/i) {
 		my $oldval = $config{$key};
-		message TF("Config '%s' set to %s (was %s)\n", $key, $val, $oldval), "info";
+		if ($val ne '' && $oldval ne '') {
+			message TF("Config '%s' set to %s (was %s)\n", $key, $val, $oldval), "info";
+		} elsif ($oldval eq '') {
+			message TF("Config '%s' set to %s\n", $key, $val), "info";
+		} else {
+			message TF("Config '%s' unset (was %s)\n", $key, $oldval), "info";
+		}
 	}
 	if ($args{autoCreate} && !exists $config{$key}) {
 		my $f;





