diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-03-23 20:55:36 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-03-23 20:55:36 +0800 |
commit | 4ffc2cfeb67b922ac4885ac9443a45c9dc5ef17c (patch) | |
tree | e525a7b0dbd99c6106fb986a937f02ae5d7a9928 /mbbsd | |
parent | 8546759cec4d91a22da56ee261f6aac0d77abd5c (diff) | |
download | pttbbs-4ffc2cfeb67b922ac4885ac9443a45c9dc5ef17c.tar pttbbs-4ffc2cfeb67b922ac4885ac9443a45c9dc5ef17c.tar.gz pttbbs-4ffc2cfeb67b922ac4885ac9443a45c9dc5ef17c.tar.bz2 pttbbs-4ffc2cfeb67b922ac4885ac9443a45c9dc5ef17c.tar.lz pttbbs-4ffc2cfeb67b922ac4885ac9443a45c9dc5ef17c.tar.xz pttbbs-4ffc2cfeb67b922ac4885ac9443a45c9dc5ef17c.tar.zst pttbbs-4ffc2cfeb67b922ac4885ac9443a45c9dc5ef17c.zip |
not necessary to keep movie history
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3490 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/cache.c | 5 | ||||
-rw-r--r-- | mbbsd/menu.c | 39 |
2 files changed, 15 insertions, 29 deletions
diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 45c21f06..b721c82b 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -885,11 +885,6 @@ reload_pttcache(void) fclose(fp); } SHM->max_film = id - 1; - SHM->max_history = SHM->max_film - 2; - if (SHM->max_history > MAX_HISTORY - 1) - SHM->max_history = MAX_HISTORY - 1; - if (SHM->max_history < 0) - SHM->max_history = 0; fp = fopen("etc/today_is", "r"); if (fp) { diff --git a/mbbsd/menu.c b/mbbsd/menu.c index 00e670f4..62e80ea2 100644 --- a/mbbsd/menu.c +++ b/mbbsd/menu.c @@ -156,37 +156,28 @@ show_status(void) outs(ANSI_RESET); } +/* + * current callee of movie: + * board.c: movie(0); // called when IN_CLASSROOT() + * // with currstat = CLASS -> don't show movies + * xyz.c: movie(999); // logout + * menu.c: movie(currstat); // ... + */ void -movie(int i) +movie(int state) { - static short history[MAX_HISTORY]; - int j; - + int i; if ((currstat != CLASS) && (cuser.uflag & MOVIE_FLAG) && !SHM->Pbusystate && SHM->max_film > 0) { - if (currstat == PSALE) { - i = PSALE; - reload_money(); + if (state == PSALE) { + reload_money(); // XXX why reload_money here? + i = state; + } else if (state == 999) { /* Goodbye my friend */ + i = 0; } else { - do { - if (!i) - i = 1 + (int)(((float)SHM->max_film * - random()) / (RAND_MAX + 1.0)); - - for (j = SHM->max_history; j >= 0; j--) - if (i == history[j]) { - i = 0; - break; - } - } while (i == 0); + i = 1 + (int)(((float)SHM->max_film * random()) / (RAND_MAX + 1.0)); } - memmove(history, &history[1], SHM->max_history * sizeof(short)); - history[SHM->max_history] = j = i; - - if (i == 999) /* Goodbye my friend */ - i = 0; - move(1, 0); clrtoline(1 + FILMROW); /* 清掉上次的 */ out_lines(SHM->notes[i], 11); /* 只印11行就好 */ |