summaryrefslogtreecommitdiff
path: root/train_gui.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-01-21 22:09:25 +0000
committerpeter1138 <peter1138@openttd.org>2006-01-21 22:09:25 +0000
commita1342c9d5250687dcb7d2f1d174f68126267ffa5 (patch)
treea193eea7ea729ac5dac3b335d6a7bb7baca3b200 /train_gui.c
parentd13763a9c4cce6ef81bb333cec241d9d7dcc633e (diff)
downloadopenttd-a1342c9d5250687dcb7d2f1d174f68126267ffa5.tar.xz
(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)
Diffstat (limited to 'train_gui.c')
-rw-r--r--train_gui.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/train_gui.c b/train_gui.c
index 95f86a47c..cf44b3d94 100644
--- a/train_gui.c
+++ b/train_gui.c
@@ -905,17 +905,21 @@ static void TrainViewWndProc(Window *w, WindowEvent *e)
v = GetVehicle(w->window_number);
- w->disabled_state = (v->owner == _local_player) ? 0 : 0x380;
+ if (v->owner != _local_player) {
+ w->disabled_state = 0x3380;
+ } else {
+ w->disabled_state = 0;
- SETBIT(w->disabled_state, 12);
+ 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;
+ /* 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;
+ }
}
}