1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-28 00:49:11 +00:00

(svn r2992) Use PlayerID, StationID and INVALID_STATION instead of int, int and -1

This commit is contained in:
tron
2005-09-27 18:51:04 +00:00
parent 50f1a93664
commit ff30404170
8 changed files with 35 additions and 31 deletions

View File

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