diff --git a/Docs/Luadoc/Lua.xml b/Docs/Luadoc/Lua.xml index 994dd0d681..a18957acd9 100644 --- a/Docs/Luadoc/Lua.xml +++ b/Docs/Luadoc/Lua.xml @@ -783,6 +783,7 @@ + diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index e2f3ea3597..34a824c103 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -2327,7 +2327,10 @@ save yourself some time, copy this for undocumented things: Returns true if player pn is the winner. - Joins player pn. + Joins player pn. Does not deduct coins. + + + Similar to JoinPlayer, but checks whether the player is allowed to join and returns false if the player is not allowed to join. Also deducts coins for joining. A player can't join if PlayersCanJoin() returns false, or that side is already joined (is true for both sides when in a style that is OnePlayerTwoSides), or there are not enough coins. Returns true if player pn is using modifier sModifier. diff --git a/src/GameState.cpp b/src/GameState.cpp index 5902ee152e..dd46fdf02a 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -2474,6 +2474,11 @@ public: static int Reset( T* p, lua_State *L ) { p->Reset(); return 0; } static int JoinPlayer( T* p, lua_State *L ) { p->JoinPlayer(Enum::Check(L, 1)); return 0; } static int UnjoinPlayer( T* p, lua_State *L ) { p->UnjoinPlayer(Enum::Check(L, 1)); return 0; } + static int JoinInput( T* p, lua_State *L ) + { + lua_pushboolean(L, p->JoinInput(Enum::Check(L, 1))); + return 1; + } static int GetSongPercent( T* p, lua_State *L ) { lua_pushnumber(L, p->GetSongPercent(FArg(1))); return 1; } DEFINE_METHOD( GetCurMusicSeconds, m_Position.m_fMusicSeconds ) @@ -2606,6 +2611,7 @@ public: ADD_METHOD( Reset ); ADD_METHOD( JoinPlayer ); ADD_METHOD( UnjoinPlayer ); + ADD_METHOD( JoinInput ); ADD_METHOD( GetSongPercent ); ADD_METHOD( GetCurMusicSeconds ); ADD_METHOD( GetCharacter );