Skip to content

Commit

Permalink
Fix a couple lua interface things with CCoff and judgement msgcommand (
Browse files Browse the repository at this point in the history
…#109)

* Fix a couple lua interface things with CCoff

* Remove redundant CountNotesSeparetely checks
  • Loading branch information
nico-abram authored and MinaciousGrace committed Nov 20, 2017
1 parent e207279 commit e103a9a
Showing 1 changed file with 37 additions and 15 deletions.
52 changes: 37 additions & 15 deletions src/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2287,7 +2287,7 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds )
tn.result.tns = TNS_Miss;
if ( GAMESTATE->CountNotesSeparately() )
{
SetJudgment(iter.Row(), m_NoteData.GetFirstTrackWithTapOrHoldHead(iter.Row()), tn);
SetJudgment(iter.Row(), iter.Track(), tn);
HandleTapRowScore(iter.Row());
}
}
Expand Down Expand Up @@ -2332,7 +2332,7 @@ void Player::UpdateJudgedRows(float fDeltaTime)
if(lastTN.result.tns < TNS_Miss )
continue;

SetJudgment( iRow, m_NoteData.GetFirstTrackWithTapOrHoldHead(iRow), lastTN );
SetJudgment( iRow, m_NoteData.GetFirstTrackWithTapOrHoldHead(iter.Row()), lastTN );
HandleTapRowScore(iRow);
}
}
Expand Down Expand Up @@ -2962,23 +2962,45 @@ void Player::SetJudgment( int iRow, int iTrack, const TapNote &tn, TapNoteScore
Lua* L= LUA->Get();
lua_createtable( L, 0, m_NoteData.GetNumTracks() ); // TapNotes this row
lua_createtable( L, 0, m_NoteData.GetNumTracks() ); // HoldHeads of tracks held at this row.

for( int iTrack = 0; iTrack < m_NoteData.GetNumTracks(); ++iTrack )
{
NoteData::iterator tn = m_NoteData.FindTapNote(iTrack, iRow);
if( tn != m_NoteData.end(iTrack) )
if (GAMESTATE->CountNotesSeparately()) {
for (int jTrack = 0; jTrack < m_NoteData.GetNumTracks(); ++jTrack)
{
tn->second.PushSelf(L);
lua_rawseti(L, -3, iTrack + 1);
NoteData::iterator tn = m_NoteData.FindTapNote(jTrack, iRow);
if (tn != m_NoteData.end(jTrack) && jTrack == iTrack )
{
tn->second.PushSelf(L);
lua_rawseti(L, -3, jTrack + 1);
}
else
{
int iHeadRow;
if (m_NoteData.IsHoldNoteAtRow(jTrack, iRow, &iHeadRow))
{
NoteData::iterator hold = m_NoteData.FindTapNote(jTrack, iHeadRow);
hold->second.PushSelf(L);
lua_rawseti(L, -2, jTrack + 1);
}
}
}
else
}
else {
for (int jTrack = 0; jTrack < m_NoteData.GetNumTracks(); ++jTrack)
{
int iHeadRow;
if( m_NoteData.IsHoldNoteAtRow( iTrack, iRow, &iHeadRow ) )
NoteData::iterator tn = m_NoteData.FindTapNote(jTrack, iRow);
if (tn != m_NoteData.end(jTrack))
{
tn->second.PushSelf(L);
lua_rawseti(L, -3, jTrack + 1);
}
else
{
NoteData::iterator hold = m_NoteData.FindTapNote(iTrack, iHeadRow);
hold->second.PushSelf(L);
lua_rawseti(L, -2, iTrack + 1);
int iHeadRow;
if (m_NoteData.IsHoldNoteAtRow(jTrack, iRow, &iHeadRow))
{
NoteData::iterator hold = m_NoteData.FindTapNote(jTrack, iHeadRow);
hold->second.PushSelf(L);
lua_rawseti(L, -2, jTrack + 1);
}
}
}
}
Expand Down

0 comments on commit e103a9a

Please sign in to comment.