From: havoc Date: Wed, 9 May 2007 09:29:56 +0000 (+0000) Subject: fix broken OFS_PARM0 + index code in VM_M_callfunction and X-Git-Tag: xonotic-v0.1.0preview~3193 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=a061b6f8b275b30be517e546c3df0797f8c77cf3 fix broken OFS_PARM0 + index code in VM_M_callfunction and 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 --- diff --git a/mvm_cmds.c b/mvm_cmds.c index 80ea17e2..7ed9c135 100644 --- a/mvm_cmds.c +++ b/mvm_cmds.c @@ -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); diff --git a/prvm_cmds.c b/prvm_cmds.c index 9b3dfb7c..f4d62ce5 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -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++; }