Only apply booleans if they're true
This commit is contained in:
@@ -240,10 +240,15 @@ namespace TerraTech {
|
|||||||
|
|
||||||
public void Apply() {
|
public void Apply() {
|
||||||
try {
|
try {
|
||||||
|
if (_value.Value) {
|
||||||
if (Main.debug.Value)
|
if (Main.debug.Value)
|
||||||
Console.WriteLine("Applying to {0}: setting to {1}", _fieldName, _value.Value);
|
Console.WriteLine("Applying to {0}: forcing to true", _fieldName);
|
||||||
|
|
||||||
SetValue(_value.Value);
|
SetValue(true);
|
||||||
|
} else {
|
||||||
|
if (Main.debug.Value)
|
||||||
|
Console.WriteLine("Applying to {0}: leaving as {1} (config is false)", _fieldName, GetValue());
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new InvalidOperationException(string.Format("Failed to apply value to {0}", _fieldName), e);
|
throw new InvalidOperationException(string.Format("Failed to apply value to {0}", _fieldName), e);
|
||||||
}
|
}
|
||||||
@@ -259,7 +264,7 @@ namespace TerraTech {
|
|||||||
if (!Main.debug.Value)
|
if (!Main.debug.Value)
|
||||||
return;
|
return;
|
||||||
var currentValue = GetValue();
|
var currentValue = GetValue();
|
||||||
Console.WriteLine("{0} {1}; {2}: {3} (original: {4}, value: {5})", prefix, _parentTraverse, _fieldName,
|
Console.WriteLine("{0} {1}; {2}: {3} (original: {4}, config: {5})", prefix, _parentTraverse, _fieldName,
|
||||||
currentValue, _originalValue, _value.Value);
|
currentValue, _originalValue, _value.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user