fix a issue with new lines when saving player variables to file

This commit is contained in:
EricPlayZ
2024-01-06 06:02:55 +02:00
parent e785665479
commit 843e8995cc
2 changed files with 4 additions and 2 deletions

View File

@ -12,7 +12,8 @@
namespace Menu {
namespace Player {
#pragma region PlayerVarsSCRString
static const char playerVarsSCR[] = { 0x73, 0x75, 0x62, 0x20, 0x6D, 0x61, 0x69, 0x6E, 0x28, 0x29, 0x0D, 0x0A, 0x7B, 0x0D, 0x0A, 0x09,
extern const char playerVarsSCR[];
const char playerVarsSCR[] = { 0x73, 0x75, 0x62, 0x20, 0x6D, 0x61, 0x69, 0x6E, 0x28, 0x29, 0x0D, 0x0A, 0x7B, 0x0D, 0x0A, 0x09,
0x50, 0x61, 0x72, 0x61, 0x6D, 0x28, 0x22, 0x41, 0x6E, 0x69, 0x6D, 0x47, 0x72, 0x61, 0x70, 0x68,
0x5F, 0x42, 0x61, 0x6E, 0x6B, 0x4E, 0x61, 0x6D, 0x65, 0x22, 0x2C, 0x20, 0x22, 0x70, 0x6C, 0x61,
0x79, 0x65, 0x72, 0x22, 0x29, 0x3B, 0x0D, 0x0A, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6D, 0x28, 0x22,
@ -6084,7 +6085,7 @@ namespace Menu {
Utils::str_replace(tempPlayerVarsSCR, origLine, line);
}
std::ofstream outFile(std::string(saveSCRPath) + "\\player_variables.scr");
std::ofstream outFile(std::string(saveSCRPath) + "\\player_variables.scr", std::ios::binary);
if (!outFile.is_open()) {
ImGui::OpenPopup("Failed saving.");
return;

View File

@ -4,6 +4,7 @@
namespace Menu {
namespace Player {
extern const char playerVarsSCR[];
extern SMART_BOOL godModeEnabled;
extern SMART_BOOL freezePlayerEnabled;