- reduce backend's dependency on game state by using callbacks.

This commit is contained in:
Christoph Oelckers 2020-04-11 18:22:21 +02:00
commit 56f2b2ac56
29 changed files with 289 additions and 276 deletions

View file

@ -470,6 +470,43 @@ void FCajunMaster::ForgetBots ()
botinfo = NULL;
}
#if defined _WIN32 || defined __APPLE__
FString M_GetCajunPath(const char* botfilename)
{
FString path;
path << progdir << "zcajun/" << botfilename;
if (!FileExists(path))
{
path = "";
}
return path;
}
#else
FString M_GetCajunPath(const char* botfilename)
{
FString path;
// Check first in $HOME/.config/zdoom/botfilename.
path = GetUserFile(botfilename);
if (!FileExists(path))
{
// Then check in SHARE_DIR/botfilename.
path = SHARE_DIR;
path << botfilename;
if (!FileExists(path))
{
path = "";
}
}
return path;
}
#endif
bool FCajunMaster::LoadBots ()
{
FScanner sc;