GameState: Expose GetPlayerFailType() to Lua

FailType for a given Player can be overriden with respect to preferences, but
Lua has no way to check it. Expose a function to allow doing that, in order to
not accidentally submit invalid scores to GrooveStats.
This commit is contained in:
phantom10111
2025-01-20 10:03:52 -08:00
committed by teejusb
parent 6aa81a9dd2
commit 3266fda819
4 changed files with 13 additions and 0 deletions
+8
View File
@@ -3357,6 +3357,13 @@ public:
p->m_autogen_fargs[si]= v;
COMMON_RETURN_SELF;
}
static int GetPlayerFailType(T* p, lua_State* L)
{
Enum::Push(L, p->GetPlayerFailType(Enum::Check<PlayerNumber>(L, 1)));
return 1;
}
static int prepare_song_for_gameplay(T* p, lua_State* L)
{
int result= p->prepare_song_for_gameplay();
@@ -3490,6 +3497,7 @@ public:
ADD_METHOD( SetStepsForEditMode );
ADD_METHOD( GetAutoGenFarg );
ADD_METHOD( SetAutoGenFarg );
ADD_METHOD( GetPlayerFailType );
ADD_METHOD(prepare_song_for_gameplay);
}
};
+1
View File
@@ -336,6 +336,7 @@ public:
bool PlayerIsUsingModifier( PlayerNumber pn, const RString &sModifier );
FailType GetPlayerFailType( const PlayerState *pPlayerState ) const;
FailType GetPlayerFailType( PlayerNumber pn ) const { return GetPlayerFailType( m_pPlayerState[pn] ); }
// character stuff
Character* m_pCurCharacters[NUM_PLAYERS];