From 314a4245a9286ef32e717a70af6d71b136255894 Mon Sep 17 00:00:00 2001 From: celestar Date: Fri, 14 Jan 2005 09:36:29 +0000 Subject: [PATCH] (svn r1505) -Fix: Refit engine button is now disabled when cargo capacity equals zero --- train_gui.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/train_gui.c b/train_gui.c index 270a436724..09e5644ad4 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);