summaryrefslogtreecommitdiff
path: root/train_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-09-27 18:51:04 +0000
committertron <tron@openttd.org>2005-09-27 18:51:04 +0000
commitff304041700c85e587babffdb99ba1c9ff399fc1 (patch)
treed804f18dd3f887e39dcfe68e8510f4ada9a171f9 /train_gui.c
parent50f1a93664c09bff09c0c5e06d73f515ecf90733 (diff)
downloadopenttd-ff304041700c85e587babffdb99ba1c9ff399fc1.tar.xz
(svn r2992) Use PlayerID, StationID and INVALID_STATION instead of int, int and -1
Diffstat (limited to 'train_gui.c')
-rw-r--r--train_gui.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/train_gui.c b/train_gui.c
index 3c02fa561..08b4a15f6 100644
--- a/train_gui.c
+++ b/train_gui.c
@@ -1370,8 +1370,8 @@ static const Widget _other_player_trains_widgets[] = {
static void PlayerTrainsWndProc(Window *w, WindowEvent *e)
{
- int station = (int)w->window_number >> 16;
- int owner = w->window_number & 0xff;
+ StationID station = GB(w->window_number, 16, 16);
+ PlayerID owner = GB(w->window_number, 0, 8);
vehiclelist_d *vl = &WP(w, vehiclelist_d);
switch(e->event) {
@@ -1393,7 +1393,7 @@ static void PlayerTrainsWndProc(Window *w, WindowEvent *e)
/* draw the widgets */
{
const Player *p = GetPlayer(owner);
- if (station == -1) {
+ if (station == INVALID_STATION) {
/* Company Name -- (###) Trains */
SetDParam(0, p->name_1);
SetDParam(1, p->name_2);
@@ -1567,7 +1567,7 @@ static const WindowDesc _other_player_trains_desc = {
PlayerTrainsWndProc
};
-void ShowPlayerTrains(int player, int station)
+void ShowPlayerTrains(PlayerID player, StationID station)
{
Window *w;