mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
File score: report file opening errors
This commit is contained in:
parent
279d6e60ca
commit
0a286b1d94
|
@ -70,7 +70,11 @@ void CFileScore::SaveScoreThread(void *pUser)
|
||||||
lock_wait(gs_ScoreLock);
|
lock_wait(gs_ScoreLock);
|
||||||
std::fstream f;
|
std::fstream f;
|
||||||
f.open(SaveFile().c_str(), std::ios::out);
|
f.open(SaveFile().c_str(), std::ios::out);
|
||||||
if (!f.fail())
|
if(f.fail())
|
||||||
|
{
|
||||||
|
dbg_msg("filescore", "opening '%s' for writing failed", SaveFile().c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
int t = 0;
|
int t = 0;
|
||||||
for (sorted_array<CPlayerScore>::range r = pSelf->m_Top.all();
|
for (sorted_array<CPlayerScore>::range r = pSelf->m_Top.all();
|
||||||
|
@ -109,6 +113,10 @@ void CFileScore::Init()
|
||||||
std::fstream f;
|
std::fstream f;
|
||||||
f.open(SaveFile().c_str(), std::ios::in);
|
f.open(SaveFile().c_str(), std::ios::in);
|
||||||
|
|
||||||
|
if(f.fail())
|
||||||
|
{
|
||||||
|
dbg_msg("filescore", "opening '%s' for reading failed", SaveFile().c_str());
|
||||||
|
}
|
||||||
while (!f.eof() && !f.fail())
|
while (!f.eof() && !f.fail())
|
||||||
{
|
{
|
||||||
std::string TmpName, TmpScore, TmpCpLine;
|
std::string TmpName, TmpScore, TmpCpLine;
|
||||||
|
|
Loading…
Reference in a new issue