summaryrefslogtreecommitdiff
path: root/network_server.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-10-14 22:31:18 +0000
committerDarkvater <Darkvater@openttd.org>2006-10-14 22:31:18 +0000
commit4c9d9a87f18191ae9ae4368176c96b89dd172c8f (patch)
tree52f21281bd10b45ef340a15357a04bf130b9b554 /network_server.c
parent2380bb56cd4a25eef126153bb6b5ccde8222fc5c (diff)
downloadopenttd-4c9d9a87f18191ae9ae4368176c96b89dd172c8f.tar.xz
(svn r6776) -Codechange: Use IsValidPlayer() function to determine of a PlayerID is an
actual playable player (< MAX_PLAYERS) or not.
Diffstat (limited to 'network_server.c')
-rw-r--r--network_server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/network_server.c b/network_server.c
index 2e7adc021..e64f723e3 100644
--- a/network_server.c
+++ b/network_server.c
@@ -1232,7 +1232,7 @@ void NetworkPopulateCompanyInfo(void)
// Go through all vehicles and count the type of vehicles
FOR_ALL_VEHICLES(v) {
- if (v->owner >= MAX_PLAYERS) continue;
+ if (!IsValidPlayer(v->owner)) continue;
switch (v->type) {
case VEH_Train:
if (IsFrontEngine(v)) {
@@ -1266,7 +1266,7 @@ void NetworkPopulateCompanyInfo(void)
// Go through all stations and count the types of stations
FOR_ALL_STATIONS(s) {
- if (s->owner < MAX_PLAYERS) {
+ if (IsValidPlayer(s->owner)) {
NetworkPlayerInfo* npi = &_network_player_info[s->owner];
if (s->facilities & FACIL_TRAIN) npi->num_station[0]++;