From 2d2e1e386315db0c83f508c19387e9f2e0c9cee1 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 9 Jan 2008 21:05:03 +0000 Subject: (svn r11800) -Codechange: move some functions to a more logical location + some type safety. --- src/players.cpp | 43 ++----------------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) (limited to 'src/players.cpp') diff --git a/src/players.cpp b/src/players.cpp index b0314f685..9c0ee2e67 100644 --- a/src/players.cpp +++ b/src/players.cpp @@ -32,6 +32,8 @@ #include "string_func.h" #include "ai/default/default.h" #include "ai/trolly/trolly.h" +#include "road_func.h" +#include "rail.h" /** * Sets the local player and updates the patch settings that are set on a @@ -590,47 +592,6 @@ void PlayersYearlyLoop() } } -byte GetPlayerRailtypes(PlayerID p) -{ - byte rt = 0; - EngineID i; - - for (i = 0; i != TOTAL_NUM_ENGINES; i++) { - const Engine* e = GetEngine(i); - const EngineInfo *ei = EngInfo(i); - - if (e->type == VEH_TRAIN && HasBit(ei->climates, _opt.landscape) && - (HasBit(e->player_avail, p) || _date >= e->intro_date + 365)) { - const RailVehicleInfo *rvi = RailVehInfo(i); - - if (rvi->railveh_type != RAILVEH_WAGON) { - assert(rvi->railtype < RAILTYPE_END); - SetBit(rt, rvi->railtype); - } - } - } - - return rt; -} - -byte GetPlayerRoadtypes(PlayerID p) -{ - byte rt = 0; - EngineID i; - - for (i = 0; i != TOTAL_NUM_ENGINES; i++) { - const Engine* e = GetEngine(i); - const EngineInfo *ei = EngInfo(i); - - if (e->type == VEH_ROAD && HasBit(ei->climates, _opt.landscape) && - (HasBit(e->player_avail, p) || _date >= e->intro_date + 365)) { - SetBit(rt, HasBit(ei->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD); - } - } - - return rt; -} - static void DeletePlayerStuff(PlayerID pi) { Player *p; -- cgit v1.2.3-54-g00ecf