(svn r6776) -Codechange: Use IsValidPlayer() function to determine of a PlayerID is an

actual playable player (< MAX_PLAYERS) or not.
This commit is contained in:
Darkvater
2006-10-14 22:31:18 +00:00
parent 9732c129c1
commit 6b6d908308
15 changed files with 50 additions and 49 deletions

View File

@@ -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]++;