SteamTarget: Fix reading settings

pull/183/head
Peter Repukat 2 years ago
parent a1397e05da
commit 5ff02433db

@ -172,7 +172,7 @@ inline void Parse(std::wstring arg1)
// TODO: make this as much generic as fits in about the same amount of code if one would parse every value separately. // TODO: make this as much generic as fits in about the same amount of code if one would parse every value separately.
try { try {
if (auto launchconf = json["launch"]; launchconf.is_null() && launchconf.empty() && launchconf.is_object()) { if (auto launchconf = json["launch"]; !launchconf.is_null() && !launchconf.empty() && launchconf.is_object()) {
safeParseValue(launchconf, "launch", launch.launch); safeParseValue(launchconf, "launch", launch.launch);
safeWStringParse(launchconf, "launchPath", launch.launchPath); safeWStringParse(launchconf, "launchPath", launch.launchPath);
safeWStringParse(launchconf, "launchAppArgs", launch.launchAppArgs); safeWStringParse(launchconf, "launchAppArgs", launch.launchAppArgs);
@ -180,19 +180,19 @@ inline void Parse(std::wstring arg1)
safeParseValue(launchconf, "waitForChildProcs", launch.waitForChildProcs); safeParseValue(launchconf, "waitForChildProcs", launch.waitForChildProcs);
} }
if (auto devconf = json["devices"]; devconf.is_null() && devconf.empty() && devconf.is_object()) { if (auto devconf = json["devices"]; !devconf.is_null() && !devconf.empty() && devconf.is_object()) {
safeParseValue(devconf, "hideDevices", devices.hideDevices); safeParseValue(devconf, "hideDevices", devices.hideDevices);
safeParseValue(devconf, "realDeviceIds", devices.realDeviceIds); safeParseValue(devconf, "realDeviceIds", devices.realDeviceIds);
} }
if (auto winconf = json["window"]; winconf.is_null() && winconf.empty() && winconf.is_object()) { if (auto winconf = json["window"]; !winconf.is_null() && !winconf.empty() && winconf.is_object()) {
safeParseValue(winconf, "windowMode", window.windowMode); safeParseValue(winconf, "windowMode", window.windowMode);
safeParseValue(winconf, "maxFps", window.maxFps); safeParseValue(winconf, "maxFps", window.maxFps);
safeParseValue(winconf, "scale", window.scale); safeParseValue(winconf, "scale", window.scale);
safeParseValue(winconf, "disableOverlay", window.disableOverlay); safeParseValue(winconf, "disableOverlay", window.disableOverlay);
} }
if (auto controllerConf = json["controller"]; controllerConf.is_null() && controllerConf.empty() && controllerConf.is_object()) { if (auto controllerConf = json["controller"]; !controllerConf.is_null() && !controllerConf.empty() && controllerConf.is_object()) {
safeParseValue(controllerConf, "maxControllers", controller.maxControllers); safeParseValue(controllerConf, "maxControllers", controller.maxControllers);
safeParseValue(controllerConf, "allowDesktopConfig", controller.allowDesktopConfig); safeParseValue(controllerConf, "allowDesktopConfig", controller.allowDesktopConfig);
safeParseValue(controllerConf, "emulateDS4", controller.emulateDS4); safeParseValue(controllerConf, "emulateDS4", controller.emulateDS4);

Loading…
Cancel
Save