diff options
author | celestar <celestar@openttd.org> | 2005-07-20 22:02:58 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2005-07-20 22:02:58 +0000 |
commit | 18a93cca3d4c590949015ff56e34d8906c60199a (patch) | |
tree | 0116afc35d1c231116095467d18c2295cbffa8f1 /main_gui.c | |
parent | 030c37160db989c0c67ab3817381787e6c8d8d20 (diff) | |
download | openttd-18a93cca3d4c590949015ff56e34d8906c60199a.tar.xz |
(svn r2657) -Codechange: The available railtypes per player are now a bitmask, so
that railtypes do not be in ascending order of appearance. Allows easier
implementation or more railtypes
Diffstat (limited to 'main_gui.c')
-rw-r--r-- | main_gui.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/main_gui.c b/main_gui.c index 707eb46af..244cb2be0 100644 --- a/main_gui.c +++ b/main_gui.c @@ -327,8 +327,7 @@ static void MenuClickShowAir(int index) static void MenuClickBuildRail(int index) { - Player *p = GetPlayer(_local_player); - _last_built_railtype = min(index, p->max_railtype-1); + _last_built_railtype = index; ShowBuildRailToolbar(_last_built_railtype, -1); } @@ -941,7 +940,7 @@ static void ToolbarBuildRailClick(Window *w) { Player *p = GetPlayer(_local_player); Window *w2; - w2 = PopupMainToolbMenu(w, 457, 19, STR_1015_RAILROAD_CONSTRUCTION, p->max_railtype); + w2 = PopupMainToolbMenu(w, 457, 19, STR_1015_RAILROAD_CONSTRUCTION, GetNumRailtypes(p)); WP(w2,menu_d).sel_index = _last_built_railtype; } |