From 969efc7f0f4258a7aa915a5eb6d20c3b28b43c6a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 7 Sep 2006 22:11:54 +0000 Subject: [PATCH] fix GetTotalSeconds --- stepmania/src/Course.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 4c00699eaa..725b3ccb00 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -926,11 +926,12 @@ public: static int GetEstimatedNumStages( T* p, lua_State *L ) { lua_pushnumber(L, p->GetEstimatedNumStages() ); return 1; } static int GetTotalSeconds( T* p, lua_State *L ) { - StepsType st = StepsType( IArg(1) ); - float fOut = 0.0f; - - p->GetTotalSeconds( st, fOut ); - lua_pushnumber( L, fOut ); + StepsType st = (StepsType) IArg(1); + float fTotalSeconds; + if( !p->GetTotalSeconds(st, fTotalSeconds) ) + lua_pushnil( L ); + else + lua_pushnumber( L, fTotalSeconds ); return 1; }