mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-10 03:52:55 +02:00
Fix game path trimming in core.cpp on Windows
This commit is contained in:
parent
656e81fbb6
commit
95dc3d6908
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue