Changeset - r22396:548af29a26d3
[Not reviewed]
master
0 1 0
frosch - 8 years ago 2016-06-13 17:34:18
frosch@openttd.org
(svn r27600) -Fix: [NewGRF] shift-and-add-divide/modulo varadjusts use signed division/modulo.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/newgrf_spritegroup.cpp
Show inline comments
 
@@ -204,8 +204,8 @@ static U EvalAdjustT(const Deterministic
 
	if (adjust->type != DSGA_TYPE_NONE) value += (S)adjust->add_val;
 

	
 
	switch (adjust->type) {
 
		case DSGA_TYPE_DIV:  value /= (S)adjust->divmod_val; break;
 
		case DSGA_TYPE_MOD:  value %= (U)adjust->divmod_val; break;
 
		case DSGA_TYPE_DIV:  value = (S)value / (S)adjust->divmod_val; break;
 
		case DSGA_TYPE_MOD:  value = (S)value % (S)adjust->divmod_val; break;
 
		case DSGA_TYPE_NONE: break;
 
	}
 

	
0 comments (0 inline, 0 general)