# HG changeset patch # User peter1138 # Date 1137881365 0 # Node ID 66a9c4e27e3419381c269db0f5b5052557a50e6a # Parent 2a7069caa46f1251b35d8a15fbcd6b572344c7c9 (svn r3415) - Fix: Disable the clone and refit buttons in the train view when viewing another player's vehicles, or as a spectator. (thanks to UnderBuilder for pointing this out) diff -r 2a7069caa46f -r 66a9c4e27e34 train_gui.c --- a/train_gui.c Sat Jan 21 21:45:34 2006 +0000 +++ b/train_gui.c Sat Jan 21 22:09:25 2006 +0000 @@ -905,17 +905,21 @@ v = GetVehicle(w->window_number); - w->disabled_state = (v->owner == _local_player) ? 0 : 0x380; - - SETBIT(w->disabled_state, 12); + if (v->owner != _local_player) { + w->disabled_state = 0x3380; + } else { + w->disabled_state = 0; - /* See if any vehicle can be refitted */ - for ( u = v; u != NULL; u = u->next) { - if (_engine_info[u->engine_type].refit_mask != 0 || - (!(RailVehInfo(v->engine_type)->flags & RVI_WAGON) && v->cargo_cap != 0)) { - CLRBIT(w->disabled_state, 12); - /* We have a refittable carriage, bail out */ - break; + SETBIT(w->disabled_state, 12); + + /* See if any vehicle can be refitted */ + for (u = v; u != NULL; u = u->next) { + if (_engine_info[u->engine_type].refit_mask != 0 || + (!(RailVehInfo(v->engine_type)->flags & RVI_WAGON) && v->cargo_cap != 0)) { + CLRBIT(w->disabled_state, 12); + /* We have a refittable carriage, bail out */ + break; + } } }