mirror of
https://github.com/paxed/dgamelaunch.git
synced 2025-07-28 16:14:33 +02:00
When selecting a random game to watch, try to avoid idle games and games with too big terminals.
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@564 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
413256523c
commit
9e48fc215d
@ -775,7 +775,14 @@ inprogressmenu (int gameid)
|
|||||||
break;
|
break;
|
||||||
case '*':
|
case '*':
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
idx = random() % len;
|
int cnt = 20;
|
||||||
|
(void) time(&ctime);
|
||||||
|
do {
|
||||||
|
idx = random() % len;
|
||||||
|
} while ((--cnt > 0) ||
|
||||||
|
((games[idx]->ws_col <= COLS) &&
|
||||||
|
(games[idx]->ws_row <= LINES) &&
|
||||||
|
((ctime - games[idx]->idle_time) < 15)));
|
||||||
selected = idx;
|
selected = idx;
|
||||||
goto watchgame;
|
goto watchgame;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user