diff options
author | celestar <celestar@openttd.org> | 2007-01-11 11:05:01 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2007-01-11 11:05:01 +0000 |
commit | 2ac0410767683fb0e6315433f9805712cb85f5bd (patch) | |
tree | f9cb6bcd0d0b855706d1e00e0a4ffd2757c7e039 /src/settings_gui.cpp | |
parent | 7996c9e560f61cddba0a3ad48b95c81d9030ef99 (diff) | |
download | openttd-2ac0410767683fb0e6315433f9805712cb85f5bd.tar.xz |
(svn r8055) -Codechange: Replace the different max, dmax, maxu whatever macros by a simple template function max(), that requires two arguments of the same type. While I'm at it change a variable called "max" to "maxval" in a function that calls max().
Diffstat (limited to 'src/settings_gui.cpp')
-rw-r--r-- | src/settings_gui.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index d3d5dcbf6..e3253f460 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -437,7 +437,7 @@ static void GameDifficultyWndProc(Window *w, WindowEvent *e) const GameSettingData *info; int x, y; uint btn, dis; - int val; + int16 val; // Don't allow clients to make any changes if (_networking && !_network_server) @@ -473,7 +473,8 @@ static void GameDifficultyWndProc(Window *w, WindowEvent *e) SETBIT(_difficulty_click_b, btn); } else { // Decrease button clicked - val = max(val - info->step, info->min); + val -= info->step; + val = max(val, info->min); SETBIT(_difficulty_click_a, btn); } |