Tetris: take upper halves into account for PieceStuck()

pull/426/head
nick black 4 years ago
parent d5e0b24f01
commit 642741f2c9
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -6,6 +6,17 @@ bool PieceStuck() {
int y, x;
curpiece_->get_dim(&y, &x);
while(x--){
ncpp::Cell piecec;
if(curpiece_->get_at(y - 1, x, &piecec) < 0){
throw TetrisNotcursesErr("get_at()");
}
if(!piecec.get().gcluster || piecec.get().gcluster == ' '){
continue;
}
const char* egc = curpiece_->get_extended_gcluster(piecec);
if(strcmp(egc, "") && strcmp(egc, "")){
continue;
}
int cmpy = y, cmpx = x; // need game area coordinates via translation
curpiece_->translate(*board_, &cmpy, &cmpx);
ncpp::Cell c;

Loading…
Cancel
Save