summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/pmore.c22
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;