diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/newgrf_spritegroup.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp index 96ebdf093..5a53e3b6a 100644 --- a/src/newgrf_spritegroup.cpp +++ b/src/newgrf_spritegroup.cpp @@ -194,11 +194,9 @@ static U EvalAdjustT(const DeterministicSpriteGroupAdjust *adjust, ScopeResolver value >>= adjust->shift_num; value &= adjust->and_mask; - if (adjust->type != DSGA_TYPE_NONE) value += (S)adjust->add_val; - switch (adjust->type) { - 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_DIV: value = ((S)value + (S)adjust->add_val) / (S)adjust->divmod_val; break; + case DSGA_TYPE_MOD: value = ((S)value + (S)adjust->add_val) % (S)adjust->divmod_val; break; case DSGA_TYPE_NONE: break; } |