From 2480601477f63d4ec035dad9de84b5f5b54c73a6 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 1 Nov 2015 16:46:47 +0100 Subject: [PATCH] Fixed: Crash when displaying configuration window --- code/ryzom/client/src/init.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 9b5e5ca10..a3a5baddf 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -953,7 +953,7 @@ void prelogInit() return; } - if (ClientCfg.Width <= 0 || ClientCfg.Height <= 0) + if (ClientCfg.Width < 800 || ClientCfg.Height < 600) { UDriver::CMode mode; @@ -967,6 +967,15 @@ void prelogInit() ClientCfg.Width = 1024; ClientCfg.Height = 768; } + + // update client.cfg with detected resolution + CConfigFile::CVar *varPtr = ClientCfg.ConfigFile.getVarPtr("Width"); + if(varPtr) + varPtr->forceAsInt(ClientCfg.Width); + + varPtr = ClientCfg.ConfigFile.getVarPtr("Height"); + if(varPtr) + varPtr->forceAsInt(ClientCfg.Height); } CLoginProgressPostThread::getInstance().step(CLoginStep(LoginStep_VideoModeSetup, "login_step_video_mode_setup"));