summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-30 18:20:26 +0000
committerrubidium <rubidium@openttd.org>2008-05-30 18:20:26 +0000
commit2f3b88ef9a217e911c897de49cc616e73a233b59 (patch)
treeae098eb73283ba9ab9875b3df24bbe3b5eb7fef1 /src/economy.cpp
parente81386476f09997485e7f707f3349685e2140a97 (diff)
downloadopenttd-2f3b88ef9a217e911c897de49cc616e73a233b59.tar.xz
(svn r13343) -Codechange: reorder/move variable/functions in the network headers so that nothing from the network directory needs to include basically all network headers.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 68ff2572e..03a15ab25 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -14,7 +14,7 @@
#include "town.h"
#include "news_func.h"
#include "network/network.h"
-#include "network/network_data.h"
+#include "network/network_func.h"
#include "variables.h"
#include "vehicle_gui.h"
#include "ai/ai.h"
@@ -488,25 +488,7 @@ static void ChangeNetworkOwner(PlayerID current_player, PlayerID new_player)
if (!_network_server) return;
- /* The server has to handle all administrative issues, for example
- * updating and notifying all clients of what has happened */
- NetworkTCPSocketHandler *cs;
- NetworkClientInfo *ci = NetworkFindClientInfoFromIndex(NETWORK_SERVER_INDEX);
-
- /* The server has just changed from player */
- if (current_player == ci->client_playas) {
- ci->client_playas = new_player;
- NetworkUpdateClientInfo(NETWORK_SERVER_INDEX);
- }
-
- /* Find all clients that were in control of this company, and mark them as new_player */
- FOR_ALL_CLIENTS(cs) {
- ci = DEREF_CLIENT_INFO(cs);
- if (current_player == ci->client_playas) {
- ci->client_playas = new_player;
- NetworkUpdateClientInfo(ci->client_index);
- }
- }
+ NetworkServerChangeOwner(current_player, new_player);
#endif /* ENABLE_NETWORK */
}