diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-04 16:03:42 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-04 16:03:42 +0800 |
commit | 56abc87c416464be55ab90ea63ed8be3a09f00fe (patch) | |
tree | 05e6a5c824df489ef1bcd6b18fd3bd9535280388 | |
parent | 1264b9a7758e79ad94f46b0d47749f38a97e72ab (diff) | |
download | pttbbs-56abc87c416464be55ab90ea63ed8be3a09f00fe.tar pttbbs-56abc87c416464be55ab90ea63ed8be3a09f00fe.tar.gz pttbbs-56abc87c416464be55ab90ea63ed8be3a09f00fe.tar.bz2 pttbbs-56abc87c416464be55ab90ea63ed8be3a09f00fe.tar.lz pttbbs-56abc87c416464be55ab90ea63ed8be3a09f00fe.tar.xz pttbbs-56abc87c416464be55ab90ea63ed8be3a09f00fe.tar.zst pttbbs-56abc87c416464be55ab90ea63ed8be3a09f00fe.zip |
- pmore: add random for goto
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3627 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/pmore.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c index 5b5f424a..4c35145e 100644 --- a/mbbsd/pmore.c +++ b/mbbsd/pmore.c @@ -3287,9 +3287,29 @@ mf_movieProcessCommand(unsigned char *p, unsigned char *end) else if (*p == 'G') { // GOTO - // Gt+-n + // Gt+-n,t+-n,t+-n (random select one) // jump +-n of type(l,p,f) + // random select, if multiple + unsigned char *pe = p; + unsigned int igs = 0; + + for (pe = p ; pe < end && *pe && + *pe > ' ' && *pe < 0x80 + ; pe ++) + if (*pe == ',') igs++; + + if (igs) + { + for (pe = p ; igs > 0 && pe < end && *pe && + *pe > ' ' && *pe < 0x80 + ; pe ++) + if (*pe == ',') igs--; + + if (pe != p) + p = pe-1; + } + mf_movieExecuteOffsetCmd(p+1, end); MOVIECMD_SKIP_ALL(p,end); return p; |