Skip to content

Commit

Permalink
Update Character.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterCouto committed Aug 8, 2022
1 parent 2a66590 commit 3a0a34b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions source/d2ce/Character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,23 @@ bool d2ce::Character::save(bool backup)
return false;
}
}

m_tempfilename = origFileNameBase;
m_tempfilename.replace_extension(".ctl");
if (std::filesystem::exists(m_tempfilename))
{
std::filesystem::path tempPath = fileNameBase;
tempPath.replace_extension(".ctl");
try
{
std::filesystem::rename(m_tempfilename, tempname);
}
catch (std::filesystem::filesystem_error const&)
{
m_error_code = std::make_error_code(CharacterErrc::AuxFileRenameError);
return false;
}
}
}
}

Expand Down

0 comments on commit 3a0a34b

Please sign in to comment.