From 906a606418a6d41326d4304df1d07424acfc643d Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 16 May 2007 21:33:07 +0000 Subject: [PATCH] (svn r9858) [0.5] -Backport from trunk (r9771, r9856): - Feature: Add password protected status to 'players' (network server) console command (r9771) - Fix: Loading some TTDP savegames caused an instant assertion on loading (r9857) --- console_cmds.c | 16 ++++++++++------ oldloader.c | 4 ++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/console_cmds.c b/console_cmds.c index 5077c5c4a3..ce5a203b1a 100644 --- a/console_cmds.c +++ b/console_cmds.c @@ -1216,16 +1216,20 @@ DEF_CONSOLE_CMD(ConPlayers) FOR_ALL_PLAYERS(p) { char buffer[512]; + const NetworkPlayerInfo *npi; if (!p->is_active) continue; + npi = &_network_player_info[p->index]; + GetString(buffer, STR_00D1_DARK_BLUE + _player_colors[p->index], lastof(buffer)); - IConsolePrintF(8, "#:%d(%s) Company Name: '%s' Year Founded: %d Money: %d Loan: %d Value: %" OTTD_PRINTF64 "d (T:%d, R:%d, P:%d, S:%d)", - p->index + 1, buffer, _network_player_info[p->index].company_name, p->inaugurated_year, p->player_money, p->current_loan, CalculateCompanyValue(p), - /* trains */ _network_player_info[p->index].num_vehicle[0], - /* lorry + bus */ _network_player_info[p->index].num_vehicle[1] + _network_player_info[p->index].num_vehicle[2], - /* planes */ _network_player_info[p->index].num_vehicle[3], - /* ships */ _network_player_info[p->index].num_vehicle[4]); + IConsolePrintF(8, "#:%d(%s) Company Name: '%s' Year Founded: %d Money: %d Loan: %d Value: %" OTTD_PRINTF64 "d (T:%d, R:%d, P:%d, S:%d) %sprotected", + p->index + 1, buffer, npi->company_name, p->inaugurated_year, p->player_money, p->current_loan, CalculateCompanyValue(p), + /* trains */ npi->num_vehicle[0], + /* lorry + bus */ npi->num_vehicle[1] + npi->num_vehicle[2], + /* planes */ npi->num_vehicle[3], + /* ships */ npi->num_vehicle[4], + /* protected */ npi->password[0] == '\0' ? "un" : ""); } return true; diff --git a/oldloader.c b/oldloader.c index 8c644d3155..70d8c79954 100644 --- a/oldloader.c +++ b/oldloader.c @@ -344,6 +344,9 @@ static void FixOldVehicles(void) FOR_ALL_VEHICLES(v) { Vehicle *u; + /* We haven't used this bit for stations for ages */ + if (v->type == VEH_Road) CLRBIT(v->u.road.state, 2); + FOR_ALL_VEHICLES_FROM(u, v->index + 1) { /* If a vehicle has the same orders, add the link to eachother * in both vehicles */ @@ -1511,6 +1514,7 @@ static bool LoadOldMain(LoadgameState *ls) for (i = 0; i < OLD_MAP_SIZE; i ++) { switch (GetTileType(i)) { + case MP_STATION: _m[i].m4 = 0; break; // We don't understand this grf mapping (yet) case MP_RAILWAY: /* We save presignals different from TTDPatch, convert them */ if (GetRailTileType(i) == RAIL_TILE_SIGNALS) {