Skip to content

Commit

Permalink
Fix bug of disappeared piece
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Israel Orta Orta committed Apr 29, 2024
1 parent 0780fc1 commit 3e786c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tetris.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ void FillOutput(){
CopyMem((char*)NextPzBuffer[i],oOutput,sizeof(char)*MAXWIDTH*MAXWIDTH);
}
for(j = 0; j < COLS ; j++){
if((i < MAXWIDTH && j < MAXWIDTH) && current.row >=0 && current.col >= 0 && current.array[i][j])
if((i < MAXWIDTH && j < MAXWIDTH) && current.row >=0 && current.array[i][j])
Buffer[current.row+i][current.col+j] = current.array[i][j];
if((i < MAXWIDTH && j < MAXWIDTH) && temp.row >=0 && temp.col >= 0 && temp.row - 1 > current.row && temp.array[i][j])
if((i < MAXWIDTH && j < MAXWIDTH) && temp.row >=0 && temp.row - 1 > current.row && temp.array[i][j])
Buffer[temp.row+i][temp.col+j] = tolower(temp.array[i][j]);
Buffer[i][j] = (Table[i][j] + Buffer[i][j]) ? (Buffer[i][j]?Buffer[i][j]:Table[i][j]): '.';
}
Expand Down

0 comments on commit 3e786c1

Please sign in to comment.