diff options
author | frosch <frosch@openttd.org> | 2016-06-13 17:34:18 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2016-06-13 17:34:18 +0000 |
commit | 2782993dd789d7bedab9f07b761221b0da7e80c0 (patch) | |
tree | 14ef7371e29618e372431c3ee02502e91b27ac8c | |
parent | 37e263e4fa40f883b6ddda3cfe4f1fbc0fee2632 (diff) | |
download | openttd-2782993dd789d7bedab9f07b761221b0da7e80c0.tar.xz |
(svn r27600) -Fix: [NewGRF] shift-and-add-divide/modulo varadjusts use signed division/modulo.
-rw-r--r-- | src/newgrf_spritegroup.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp index 624b4d547..c6fcd0a9e 100644 --- a/src/newgrf_spritegroup.cpp +++ b/src/newgrf_spritegroup.cpp @@ -204,8 +204,8 @@ static U EvalAdjustT(const DeterministicSpriteGroupAdjust *adjust, ScopeResolver 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; } |