Changeset - r1006:d0eeb17855a5
[Not reviewed]
master
0 1 0
celestar - 20 years ago 2005-01-14 09:36:29
celestar@openttd.org
(svn r1505) -Fix: Refit engine button is now disabled when cargo capacity equals zero
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
train_gui.c
Show inline comments
 
@@ -807,24 +807,28 @@ static Widget _train_view_widgets[] = {
 

	
 
static void TrainViewWndProc(Window *w, WindowEvent *e)
 
{
 
	switch(e->event) {
 
	case WE_PAINT: {
 
		Vehicle *v;
 
		StringID str;
 

	
 
		v = GetVehicle(w->window_number);
 

	
 
		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);
 
		SetDParam(1, v->unitnumber);
 
		DrawWindowWidgets(w);
 

	
 
		/* draw the flag */
 
		DrawSprite( (v->vehstatus&VS_STOPPED) ? 0xC12 : 0xC13, 2, 123);
 

	
 
		if (v->u.rail.crash_anim_pos != 0) {
 
			str = STR_8863_CRASHED;
 
		} else if (v->breakdown_ctr == 1) {
0 comments (0 inline, 0 general)