]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix broken OFS_PARM0 + index code in VM_M_callfunction and
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 9 May 2007 09:29:56 +0000 (09:29 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 9 May 2007 09:29:56 +0000 (09:29 +0000)
VM_tokenizebyseparator, these were not multiplying by 3 as is required

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7254 d7cf8633-e32d-0410-b094-e92efae38249

mvm_cmds.c
prvm_cmds.c

index 80ea17e256ad097cf675c1bbf59b7673469a508c..7ed9c135d92ae2db97ccdd3e8510a680c3913e0e 100644 (file)
@@ -134,7 +134,7 @@ void VM_M_callfunction(void)
 
        VM_SAFEPARMCOUNTRANGE(1, 8, VM_M_callfunction);
 
-       s = PRVM_G_STRING(OFS_PARM0 + (prog->argc - 1));
+       s = PRVM_G_STRING(OFS_PARM0+(prog->argc - 1)*3);
 
        VM_CheckEmptyString(s);
 
index 9b3dfb7c6fa2c44209bddfcf3a0c8361778fbac0..f4d62ce55b46fecb8884f6643786a1b7747cf127 100644 (file)
@@ -2021,10 +2021,11 @@ void VM_tokenizebyseparator (void)
        for (j = 1;j < prog->argc;j++)
        {
                // skip any blank separator strings
-               if (!PRVM_G_STRING(OFS_PARM0 + j)[0])
+               const char *s = PRVM_G_STRING(OFS_PARM0+j*3);
+               if (!s[0])
                        continue;
-               separators[numseparators] = PRVM_G_STRING(OFS_PARM0 + j);
-               separatorlen[numseparators] = strlen(separators[numseparators]);
+               separators[numseparators] = s;
+               separatorlen[numseparators] = strlen(s);
                numseparators++;
        }