summaryrefslogtreecommitdiff
path: root/train_gui.c
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2005-01-14 09:36:29 +0000
committercelestar <celestar@openttd.org>2005-01-14 09:36:29 +0000
commit314a4245a9286ef32e717a70af6d71b136255894 (patch)
tree1627a5d70c343caf1d00cbefd54e51438a7f93eb /train_gui.c
parentfebac23b25e468dbdc7491477d51458fff9e16ca (diff)
downloadopenttd-314a4245a9286ef32e717a70af6d71b136255894.tar.xz
(svn r1505) -Fix: Refit engine button is now disabled when cargo capacity equals zero
Diffstat (limited to 'train_gui.c')
-rw-r--r--train_gui.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/train_gui.c b/train_gui.c
index 270a43672..09e5644ad 100644
--- a/train_gui.c
+++ b/train_gui.c
@@ -816,6 +816,10 @@ static void TrainViewWndProc(Window *w, WindowEvent *e)
w->disabled_state = (v->owner == _local_player) ? 0 : 0x380;
+ if (v->cargo_cap == 0) {
+ //we cannot refit this engine
+ SETBIT(w->disabled_state, 12);
+ }
/* draw widgets & caption */
SetDParam(0, v->string_id);