diff options
Diffstat (limited to 'src/object')
-rw-r--r-- | src/object/robotmain.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index 012b08a..adbe81d 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -5465,9 +5465,12 @@ void CRobotMain::LoadFileScript(CObject *obj, const char* filename, int objRank, ObjectType type = obj->GetType(); if (type == OBJECT_HUMAN) return; - + + std::string fnstr = filename; + boost::replace_all(fnstr, m_dialog->GetSavegameDir(), m_dialog->GetPHYSFSSavegameDir()); //TODO: Refactor to get physfs path here + //TODO: Refactor to std::string char fn[MAX_FNAME]; - strcpy(fn, filename); + strcpy(fn, fnstr.c_str()); char* ldir = SearchLastDir(fn); if (ldir == 0) return; @@ -5534,8 +5537,11 @@ void CRobotMain::SaveFileScript(CObject *obj, const char* filename, int objRank) ObjectType type = obj->GetType(); if (type == OBJECT_HUMAN) return; + std::string fnstr = filename; + boost::replace_all(fnstr, m_dialog->GetSavegameDir(), m_dialog->GetPHYSFSSavegameDir()); //TODO: Refactor to get physfs path here + //TODO: Refactor to std::string char fn[MAX_FNAME]; - strcpy(fn, filename); + strcpy(fn, fnstr.c_str()); char* ldir = SearchLastDir(fn); if (ldir == 0) return; |