From 251358098000b2786dee4b48db611ddaf93540c8 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 12 Jun 2007 18:46:15 +0000 Subject: [PATCH] add HasTimedMods --- stepmania/src/Course.cpp | 15 ++++++++++++++- stepmania/src/Course.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 006d03498f..db85e80270 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -696,7 +696,18 @@ bool Course::HasMods() const { FOREACH_CONST( CourseEntry, m_vEntries, e ) { - if( !e->sModifiers.empty() || !e->attacks.empty() ) + if( !e->attacks.empty() ) + return true; + } + + return false; +} + +bool Course::HasTimedMods() const +{ + FOREACH_CONST( CourseEntry, m_vEntries, e ) + { + if( !e->attacks.empty() ) return true; } @@ -978,6 +989,7 @@ public: static int GetDisplayFullTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetDisplayFullTitle() ); return 1; } static int GetTranslitFullTitle( T* p, lua_State *L ) { lua_pushstring(L, p->GetTranslitFullTitle() ); return 1; } static int HasMods( T* p, lua_State *L ) { lua_pushboolean(L, p->HasMods() ); return 1; } + static int HasTimedMods( T* p, lua_State *L ) { lua_pushboolean( L, p->HasTimedMods() ); return 1; } static int GetCourseType( T* p, lua_State *L ) { lua_pushnumber(L, p->GetCourseType() ); return 1; } static int GetCourseEntry( T* p, lua_State *L ) { CourseEntry &ce = p->m_vEntries[IArg(1)]; ce.PushSelf(L); return 1; } static int GetAllTrails( T* p, lua_State *L ) @@ -1008,6 +1020,7 @@ public: ADD_METHOD( GetDisplayFullTitle ); ADD_METHOD( GetTranslitFullTitle ); ADD_METHOD( HasMods ); + ADD_METHOD( HasTimedMods ); ADD_METHOD( GetCourseType ); ADD_METHOD( GetCourseEntry ); ADD_METHOD( GetAllTrails ); diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index ac71c49642..2568145cad 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -124,6 +124,7 @@ public: void GetAllTrails( vector &AddTo ) const; int GetMeter( StepsType st, CourseDifficulty cd=Difficulty_Medium ) const; bool HasMods() const; + bool HasTimedMods() const; bool AllSongsAreFixed() const; const Style *GetCourseStyle( const Game *pGame, int iNumPlayers ) const;