Detects if the game is running in Windows directory */ This happens when ClassiCube is launched directly from shell process */ (e.g. via clicking a search result in Windows 10 start menu) */
| 1186 | /* This happens when ClassiCube is launched directly from shell process */ |
| 1187 | /* (e.g. via clicking a search result in Windows 10 start menu) */ |
| 1188 | static cc_bool IsProblematicWorkingDirectory(void) { |
| 1189 | cc_string curDir, winDir; |
| 1190 | char curPath[2048] = { 0 }; |
| 1191 | char winPath[2048] = { 0 }; |
| 1192 | |
| 1193 | GetCurrentDirectoryA(2048, curPath); |
| 1194 | GetSystemDirectoryA(winPath, 2048); |
| 1195 | |
| 1196 | curDir = String_FromReadonly(curPath); |
| 1197 | winDir = String_FromReadonly(winPath); |
| 1198 | |
| 1199 | if (String_Equals(&curDir, &winDir)) { |
| 1200 | Platform_LogConst("Working directory is System32! Changing to executable directory.."); |
| 1201 | return true; |
| 1202 | } |
| 1203 | return false; |
| 1204 | } |
| 1205 | |
| 1206 | cc_result Platform_SetDefaultCurrentDirectory(int argc, char** argv) { |
| 1207 | cc_winstring path; |
no test coverage detected