private void ValidateDouble(ref double val, String propName, double def) { if (val < 0) { ConsoleError("^b" + propName + "^n must be greater than or equal to 0, was set to " + val + ", corrected to " + def); val = def; return; } }