summaryrefslogtreecommitdiff
path: root/economy.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-11-13 20:33:51 +0000
committerbjarni <bjarni@openttd.org>2006-11-13 20:33:51 +0000
commited46b7d3807f4cd6bfe3ace57faa41076ab3e998 (patch)
tree995d92da1def66f510b9f9b1a66bbbca39cc849d /economy.c
parent21dd00b2992c84d5a17568d1de2da5f6d3439184 (diff)
downloadopenttd-ed46b7d3807f4cd6bfe3ace57faa41076ab3e998.tar.xz
(svn r7138) -Fix: [vehicle list windows] fixed a rare crash where having some (not all) vehicle list windows open for a player, that goes bankrupt would crash the game
-Codechange: closing all windows for a player will now loop all windows and close those, which got the player as caption instead of having a list of windows to close
Diffstat (limited to 'economy.c')
-rw-r--r--economy.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/economy.c b/economy.c
index cee067b42..37d0d2325 100644
--- a/economy.c
+++ b/economy.c
@@ -333,13 +333,8 @@ void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player)
} while (++tile != MapSize());
}
- // Change color of existing windows
- if (new_player != PLAYER_SPECTATOR) {
- Window *w;
- for (w = _windows; w != _last_window; w++) {
- if (w->caption_color == old_player) w->caption_color = new_player;
- }
- }
+ /* Change color of existing windows */
+ if (new_player != PLAYER_SPECTATOR) ChangeWindowOwner(old_player, new_player);
{
Player *p;