From f0d97bfdb91a2c0a17d1697b145d4df930280dbb Mon Sep 17 00:00:00 2001 From: krzys-h Date: Sun, 18 May 2014 12:12:47 +0200 Subject: Better datadir mod support --- src/object/robotmain.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/object/robotmain.cpp') diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index 256c362..2424938 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -20,6 +20,7 @@ #include "CBot/CBotDll.h" #include "app/app.h" +#include "app/gamedata.h" #include "common/event.h" #include "common/global.h" @@ -4081,7 +4082,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) if (Cmd(line, "Instructions") && !resetObject) { OpString(line, "name", name); - std::string path = m_app->GetDataFilePath(DIR_HELP, name); + std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_HELP, name); strcpy(m_infoFilename[SATCOM_HUSTON], path.c_str()); m_immediatSatCom = OpInt(line, "immediat", 0); @@ -4093,7 +4094,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) if (Cmd(line, "Satellite") && !resetObject) { OpString(line, "name", name); - std::string path = m_app->GetDataFilePath(DIR_HELP, name); + std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_HELP, name); strcpy(m_infoFilename[SATCOM_SAT], path.c_str()); continue; } @@ -4101,7 +4102,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) if (Cmd(line, "Loading") && !resetObject) { OpString(line, "name", name); - std::string path = m_app->GetDataFilePath(DIR_HELP, name); + std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_HELP, name); strcpy(m_infoFilename[SATCOM_LOADING], path.c_str()); continue; } @@ -4109,14 +4110,14 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) if (Cmd(line, "HelpFile") && !resetObject) { OpString(line, "name", name); - std::string path = m_app->GetDataFilePath(DIR_HELP, name); + std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_HELP, name); strcpy(m_infoFilename[SATCOM_PROG], path.c_str()); continue; } if (Cmd(line, "SoluceFile") && !resetObject) { OpString(line, "name", name); - std::string path = m_app->GetDataFilePath(DIR_HELP, name); + std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_HELP, name); strcpy(m_infoFilename[SATCOM_SOLUCE], path.c_str()); continue; } -- cgit v1.2.3-1-g7c22