summaryrefslogtreecommitdiff
path: root/src/players.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-01-09 21:05:03 +0000
committerrubidium <rubidium@openttd.org>2008-01-09 21:05:03 +0000
commit2d2e1e386315db0c83f508c19387e9f2e0c9cee1 (patch)
tree6b9fc11a0135e1ccdb74151dd8962e4fd5264843 /src/players.cpp
parenta5101fb403bc7220884236426c38bdafc2cd17cf (diff)
downloadopenttd-2d2e1e386315db0c83f508c19387e9f2e0c9cee1.tar.xz
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
Diffstat (limited to 'src/players.cpp')
-rw-r--r--src/players.cpp43
1 files changed, 2 insertions, 41 deletions
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;