(svn r21951) -Fix: [NewGRF] reset the carry flag every 4 bytes in action6 when adding more than one variable

This commit is contained in:
yexo 2011-02-04 08:29:14 +00:00
parent 053420399a
commit c70ee16ecf

View File

@ -5129,7 +5129,7 @@ static void CfgApply(ByteReader *buf)
uint32 value = GetParamVal(param_num + i / 4, NULL); uint32 value = GetParamVal(param_num + i / 4, NULL);
/* Reset carry flag for each iteration of the variable (only really /* Reset carry flag for each iteration of the variable (only really
* matters if param_size is greater than 4) */ * matters if param_size is greater than 4) */
if (i == 0) carry = false; if (i % 4 == 0) carry = false;
if (add_value) { if (add_value) {
uint new_value = preload_sprite[offset + i] + GB(value, (i % 4) * 8, 8) + (carry ? 1 : 0); uint new_value = preload_sprite[offset + i] + GB(value, (i % 4) * 8, 8) + (carry ? 1 : 0);