Merge pull request #7381 from sum2012/cw-cheat
Create as UTF-8 format of new cwcheat file
This commit is contained in:
commit
deb2f838d0
1 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
|||
#include "i18n/i18n.h"
|
||||
#include "UI/OnScreenDisplay.h"
|
||||
#include "Common/StringUtils.h"
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Common/FileUtil.h"
|
||||
|
@ -39,7 +41,16 @@ static void __CheatStart() {
|
|||
File::CreateFullPath(GetSysDirectory(DIRECTORY_CHEATS));
|
||||
|
||||
if (!File::Exists(activeCheatFile)) {
|
||||
File::CreateEmptyFile(activeCheatFile);
|
||||
FILE *f = File::OpenCFile(activeCheatFile, "wb");
|
||||
if (f) {
|
||||
fwrite("\xEF\xBB\xBF", 1, 3, f);
|
||||
fclose(f);
|
||||
}
|
||||
if (!File::Exists(activeCheatFile)) {
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
osm.Show(err->T("Unable to create cheat file, disk may be full"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
cheatEngine = new CWCheatEngine();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue