From 0b67f6bc64fbe4547a0e35a6aef8d3ea74467704 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sat, 4 Jun 2011 19:20:41 -0400 Subject: [PATCH] Temporarily stop lua error if no background. Caveat: if no song background, nothing shows on song load and the background jarringly comes in. Feel free to revert if this is a bad idea. --- src/Song.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Song.cpp b/src/Song.cpp index 1e737ef182..3aaeee24ac 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -1499,7 +1499,14 @@ public: static int GetSongDir( T* p, lua_State *L ) { lua_pushstring(L, p->GetSongDir() ); return 1; } static int GetMusicPath( T* p, lua_State *L ) { RString s = p->GetMusicPath(); if( s.empty() ) return 0; lua_pushstring(L, s); return 1; } static int GetBannerPath( T* p, lua_State *L ) { RString s = p->GetBannerPath(); if( s.empty() ) return 0; LuaHelpers::Push(L, s); return 1; } - static int GetBackgroundPath( T* p, lua_State *L ) { RString s = p->GetBackgroundPath(); if( s.empty() ) return 0; lua_pushstring(L, s); return 1; } + static int GetBackgroundPath( T* p, lua_State *L ) + { + RString s = p->GetBackgroundPath(); + if( s.empty() ) + s = ""; + lua_pushstring(L, s); + return 1; + } static int GetCDTitlePath( T* p, lua_State *L ) { RString s = p->GetCDTitlePath(); if( s.empty() ) return 0; LuaHelpers::Push(L, s); return 1; } static int GetLyricsPath( T* p, lua_State *L ) { RString s = p->GetLyricsPath(); if( s.empty() ) return 0; lua_pushstring(L, s); return 1; } static int GetSongFilePath( T* p, lua_State *L ) { lua_pushstring(L, p->GetSongFilePath() ); return 1; }