1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Fix locations of files

It fixes especially the navigation for the next
and previous exercise and mission.
This commit is contained in:
Mathieu Schroeter 2017-02-23 23:29:03 +01:00
parent b4aec1fb46
commit 025a121e44
2 changed files with 5 additions and 3 deletions

View File

@ -331,7 +331,8 @@ bool CDecor::FileExist (Sint32 rank, bool bUser, Sint32 &world, Sint32 &time,
AddUserPath (filename);
}
else
sprintf (filename, "data/world%.3d.blp", rank);
snprintf (filename, sizeof (filename),
(GetBaseDir () + "data/world%.3d.blp").c_str (), rank);
file = fopen (filename, "rb");
if (file == nullptr)

View File

@ -4291,8 +4291,9 @@ void CEvent::DemoRecStop()
if (m_pDemoBuffer != nullptr)
{
unlink ("data/demo.blp");
file = fopen ("data/demo.blp", "wb");
const auto demo = GetBaseDir () + "data/demo.blp";
unlink (demo.c_str ());
file = fopen (demo.c_str (), "wb");
if (file != nullptr)
{
memset (&header, 0, sizeof (DemoHeader));