(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)
This commit is contained in:
rubidium 2007-05-16 21:33:07 +00:00
parent 2c6a0e46a9
commit 906a606418
2 changed files with 14 additions and 6 deletions

View File

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

View File

@ -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) {