summaryrefslogtreecommitdiff
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
commit791782b62f896df996ee2df52c942b9ae7f1acd0 (patch)
tree1627a5d70c343caf1d00cbefd54e51438a7f93eb
parent957635121c5a141f7ed37e3972f29bcf41dcee03 (diff)
downloadopenttd-791782b62f896df996ee2df52c942b9ae7f1acd0.tar.xz
(svn r1505) -Fix: Refit engine button is now disabled when cargo capacity equals zero
-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);