equal
deleted
inserted
replaced
42 #include "track_func.h" |
42 #include "track_func.h" |
43 #include "road_func.h" |
43 #include "road_func.h" |
44 #include "rail_map.h" |
44 #include "rail_map.h" |
45 #include "signal_func.h" |
45 #include "signal_func.h" |
46 #include "gfx_func.h" |
46 #include "gfx_func.h" |
|
47 #include "autoreplace_func.h" |
47 |
48 |
48 #include "table/strings.h" |
49 #include "table/strings.h" |
49 #include "table/sprites.h" |
50 #include "table/sprites.h" |
50 |
51 |
51 /** |
52 /** |
450 } while (++tile != MapSize()); |
451 } while (++tile != MapSize()); |
451 } |
452 } |
452 |
453 |
453 /* update signals in buffer */ |
454 /* update signals in buffer */ |
454 UpdateSignalsInBuffer(); |
455 UpdateSignalsInBuffer(); |
|
456 } |
|
457 |
|
458 /* In all cases clear replace engine rules. |
|
459 * Even if it was copied, it could interfere with new owner's rules */ |
|
460 RemoveAllEngineReplacementForPlayer(GetPlayer(old_player)); |
|
461 |
|
462 if (new_player == PLAYER_SPECTATOR) { |
|
463 RemoveAllGroupsForPlayer(old_player); |
|
464 } else { |
|
465 Group *g; |
|
466 FOR_ALL_GROUPS(g) { |
|
467 if (g->owner == old_player) g->owner = new_player; |
|
468 } |
455 } |
469 } |
456 |
470 |
457 /* Change color of existing windows */ |
471 /* Change color of existing windows */ |
458 if (new_player != PLAYER_SPECTATOR) ChangeWindowOwner(old_player, new_player); |
472 if (new_player != PLAYER_SPECTATOR) ChangeWindowOwner(old_player, new_player); |
459 |
473 |