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
commit3a799389ebf915cc59b6e85346d837621ebe771a (patch)
tree82319a3d42401c6d6fa4944e99863807f05c6f5f /src/terraform_gui.cpp
parent891bec7e23a0a077df93b8fd1fe156ef059df8b4 (diff)
downloadopenttd-3a799389ebf915cc59b6e85346d837621ebe771a.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;
}
}