Changeset - r2374:b437b0660191
[Not reviewed]
master
0 1 0
tron - 19 years ago 2005-08-28 14:45:44
tron@openttd.org
(svn r2900) Fix a bug, which incremented the counter of a loop twice and therefore calculated wrong argument indices
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
strgen/strgen.c
Show inline comments
 
@@ -997,25 +997,25 @@ static void WriteStringsH(const char *fi
 
		if (rename("tmp.xxx", filename) == -1) Fatal("rename() failed");
 
	}
 
}
 

	
 
static int TranslateArgumentIdx(int argidx)
 
{
 
	int i, sum;
 

	
 
	if (argidx < 0 || argidx >= lengthof(_cur_pcs.cmd))
 
		Fatal("invalid argidx %d", argidx);
 

	
 
	for(i = sum = 0; i < argidx; i++) {
 
		const CmdStruct *cs = _cur_pcs.cmd[i++];
 
		const CmdStruct *cs = _cur_pcs.cmd[i];
 
		sum += cs ? cs->consumes : 1;
 
	}
 

	
 
	return sum;
 
}
 

	
 
static void PutArgidxCommand(void)
 
{
 
	PutByte(0x7C);
 
	PutByte(TranslateArgumentIdx(_cur_argidx));
 
}
 

	
0 comments (0 inline, 0 general)