Increment/decrement the games[] nwatchers too.

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@540 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Pasi Kallinen 2010-05-02 07:28:46 +00:00
parent 3610e6c436
commit afa0b07631
1 changed files with 6 additions and 2 deletions

View File

@ -835,8 +835,10 @@ watchgame:
shm_idx = games[idx]->shm_idx;
shm_sem_wait(shm_dg_data);
if (shm_dg_game[shm_idx].in_use &&
!strcmp(shm_dg_game[shm_idx].ttyrec_fn, games[idx]->ttyrec_fn))
!strcmp(shm_dg_game[shm_idx].ttyrec_fn, games[idx]->ttyrec_fn)) {
shm_dg_game[shm_idx].nwatchers++;
games[idx]->nwatchers++;
}
shm_sem_post(shm_dg_data);
}
#endif
@ -856,8 +858,10 @@ watchgame:
shm_sem_wait(shm_dg_data);
if (shm_dg_game[shm_idx].in_use &&
!strcmp(shm_dg_game[shm_idx].ttyrec_fn, games[idx]->ttyrec_fn) &&
(shm_dg_game[shm_idx].nwatchers > 0))
(shm_dg_game[shm_idx].nwatchers > 0)) {
shm_dg_game[shm_idx].nwatchers--;
games[idx]->nwatchers--;
}
shm_sem_post(shm_dg_data);
}
#endif