Fix game path trimming in core.cpp on Windows

This commit is contained in:
刘皓 2025-03-02 13:35:04 -05:00
parent 656e81fbb6
commit 95dc3d6908
No known key found for this signature in database
GPG key ID: 7901753DB465B711

View file

@ -166,7 +166,13 @@ static bool init_sandbox() {
&& !(parsed_game_path.length() >= 6 && std::strcmp(parsed_game_path.c_str() + (parsed_game_path.length() - 6), ".mkxpz") == 0)
&& !(parsed_game_path.length() >= 6 && std::strcmp(parsed_game_path.c_str() + (parsed_game_path.length() - 6), ".MKXPZ") == 0)
) {
size_t last_slash_index = parsed_game_path.find_last_of('/');
size_t last_slash_index = parsed_game_path.find_last_of(
#ifdef _WIN32
'\\'
#else
'/'
#endif // _WIN32
);
if (last_slash_index == std::string::npos) {
last_slash_index = 0;
}