mirror of
https://gitlab.com/2009scape/Saradomin-Launcher.git
synced 2026-08-01 14:19:14 -06:00
Fix dupe code in one line
This commit is contained in:
parent
006a89551f
commit
b96d9a2cca
1 changed files with 2 additions and 3 deletions
|
|
@ -152,11 +152,10 @@ public static class SingleplayerManagement
|
|||
public static void WriteConf(string key, object value)
|
||||
{
|
||||
_confCache[key] = value.ToString().ToLowerInvariant(); // Update cache
|
||||
var filePath = CrossPlatform.GetSingleplayerHome() + "/game/worldprops/default.conf";
|
||||
var lines = File.ReadAllLines(filePath).Select(l =>
|
||||
var lines = File.ReadAllLines(ConfPath).Select(l =>
|
||||
l.StartsWith(key + " =")
|
||||
? $"{key} = {_confCache[key]}" + (l.Contains("#") ? " " + l.Substring(l.IndexOf('#')) : "")
|
||||
: l);
|
||||
File.WriteAllLines(filePath, lines);
|
||||
File.WriteAllLines(ConfPath, lines);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue