summaryrefslogtreecommitdiff
path: root/src/terraform_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-07-18 16:40:29 +0000
committerrubidium <rubidium@openttd.org>2008-07-18 16:40:29 +0000
commitcde65455acbc10a3f64bb9d43c03b37cdf9b1c55 (patch)
tree82319a3d42401c6d6fa4944e99863807f05c6f5f /src/terraform_gui.cpp
parent56ad26a3aa231ede631d5bf8cf7e5132b2ff25a1 (diff)
downloadopenttd-cde65455acbc10a3f64bb9d43c03b37cdf9b1c55.tar.xz
(svn r13731) -Codechange: make a pool of the array of players.
Diffstat (limited to 'src/terraform_gui.cpp')
-rw-r--r--src/terraform_gui.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index 6d4b4bfbd..11e422f2d 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -562,20 +562,19 @@ static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed)
/* Set generating_world to true to get instant-green grass after removing
* player property. */
_generating_world = true;
- /* Delete all players */
- FOR_ALL_PLAYERS(p) {
- if (p->is_active) {
- ChangeOwnershipOfPlayerItems(p->index, PLAYER_SPECTATOR);
- p->is_active = false;
- }
- }
- _generating_world = false;
/* Delete all stations owned by a player */
Station *st;
FOR_ALL_STATIONS(st) {
if (IsValidPlayerID(st->owner)) delete st;
}
+
+ /* Delete all players */
+ FOR_ALL_PLAYERS(p) {
+ ChangeOwnershipOfPlayerItems(p->index, PLAYER_SPECTATOR);
+ delete p;
+ }
+ _generating_world = false;
}
}