Skip to content

Commit

Permalink
Add Lua access to PlayerOptions Invalid Turn/Mod Check
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Nov 29, 2019
1 parent f4d200a commit d80a510
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Etterna/Models/Misc/PlayerOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,12 @@ class LunaPlayerOptions : public Luna<PlayerOptions>
return 1;
}

static int ContainsTransformOrTurn(T* p, lua_State* L)
{
lua_pushboolean(L, p->ContainsTransformOrTurn());
return 1;
}

LunaPlayerOptions()
{
ADD_METHOD(IsEasierForSongAndSteps);
Expand Down Expand Up @@ -1759,6 +1765,7 @@ class LunaPlayerOptions : public Luna<PlayerOptions>
ADD_METHOD(UsingReverse);
ADD_METHOD(GetReversePercentForColumn);
ADD_METHOD(GetStepAttacks);
ADD_METHOD(ContainsTransformOrTurn);
}
};

Expand Down
2 changes: 2 additions & 0 deletions src/Etterna/Models/Misc/PlayerOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ class PlayerOptions
// and optionally set
// sErrorDetailOut
void ChooseRandomModifiers();
// Returns true for modifiers that should invalidate a score or otherwise
// make it impossible to calculate Replay info
bool ContainsTransformOrTurn() const;

// Lua
Expand Down

0 comments on commit d80a510

Please sign in to comment.