use Dirname

This commit is contained in:
Glenn Maynard
2003-10-29 20:23:38 +00:00
parent f03a889274
commit 30686e64b3
2 changed files with 4 additions and 10 deletions
+2 -6
View File
@@ -20,17 +20,13 @@
Actor* MakeActor( CString sPath )
{
CString sDir, sFName, sExt;
splitrelpath( sPath, sDir, sFName, sExt );
CString sExt = GetExtension(sPath);
sExt.MakeLower();
if( sExt=="actor" )
{
// TODO: Check for recursive loading
CString sDir, sThrowAway;
splitrelpath( sPath, sDir, sThrowAway, sThrowAway );
IniFile ini;
ini.SetPath( sPath );
ini.ReadFile();
@@ -41,7 +37,7 @@ Actor* MakeActor( CString sPath )
CString sFileName;
ini.GetValue( "Actor", "File", sFileName );
CString sNewPath = sDir+sFileName;
CString sNewPath = Dirname( sPath ) + sFileName;
if( !DoesFileExist(sNewPath) )
RageException::Throw( "The actor file '%s' references a file '%s' which doesn't exist.", sPath.c_str(), sNewPath.c_str() );