1
0
Fork 0

(svn r9853) [0.5] -Backport from trunk (r9837, r9827, r9785, r9775, r9758, r9716):

- Feature: Add server_lang in [network] section of openttd.cfg (r9716)
- Fix: [NewGRF] Catch occurance of division-by-zero in varaction handling (r9837)
- Fix: Only non dedicated servers cannot have 0 players [FS#765] (r9785)
- Fix: Remove arbitrary limit on length of NewGRF strings (r9775)
- Fix: [NewGRF] Ignore axis-bit of station tile layouts [FS#756] (r9758)
release/0.5
rubidium 2007-05-15 22:02:32 +00:00
parent c50cf74889
commit 3a195edcad
6 changed files with 92 additions and 95 deletions

View File

@ -1397,11 +1397,13 @@ void NetworkStartUp(void)
byte cl_max = _network_game_info.clients_max;
byte cp_max = _network_game_info.companies_max;
byte sp_max = _network_game_info.spectators_max;
byte s_lang = _network_game_info.server_lang;
memset(&_network_game_info, 0, sizeof(_network_game_info));
_network_game_info.clients_max = cl_max;
_network_game_info.companies_max = cp_max;
_network_game_info.spectators_max = sp_max;
_network_game_info.server_lang = s_lang;
}
// Let's load the network in windows

View File

@ -2096,11 +2096,6 @@ static void FeatureNewName(byte *buf, int len)
len -= (int)name_length;
if (name_length == 1) {
DEBUG(grf, 7) ("FeatureNewName: Can't add empty name");
} else if (name_length > 127) {
DEBUG(grf, 7) ("FeatureNewName: Too long a name (%d)", name_length);
} else {
DEBUG(grf, 8) ("FeatureNewName: %d <- %s", id, name);
switch (feature) {
@ -2171,7 +2166,6 @@ static void FeatureNewName(byte *buf, int len)
}
}
}
}
/* Action 0x05 */
static void GraphicsNew(byte *buf, int len)

View File

@ -118,10 +118,10 @@ static inline usize EvalAdjust_ ## size(const DeterministicSpriteGroupAdjust *ad
case DSGA_OP_SMAX: return max(last_value, value); \
case DSGA_OP_UMIN: return min((usize)last_value, (usize)value); \
case DSGA_OP_UMAX: return max((usize)last_value, (usize)value); \
case DSGA_OP_SDIV: return last_value / value; \
case DSGA_OP_SMOD: return last_value % value; \
case DSGA_OP_UDIV: return (usize)last_value / (usize)value; \
case DSGA_OP_UMOD: return (usize)last_value % (usize)value; \
case DSGA_OP_SDIV: return value == 0 ? last_value : last_value / value; \
case DSGA_OP_SMOD: return value == 0 ? last_value : last_value % value; \
case DSGA_OP_UDIV: return value == 0 ? (usize)last_value : (usize)last_value / (usize)value; \
case DSGA_OP_UMOD: return value == 0 ? (usize)last_value : (usize)last_value % (usize)value; \
case DSGA_OP_MUL: return last_value * value; \
case DSGA_OP_AND: return last_value & value; \
case DSGA_OP_OR: return last_value | value; \

View File

@ -1242,8 +1242,8 @@ bool AfterLoadGame(void)
// If Load Scenario / New (Scenario) Game is used,
// a player does not exist yet. So create one here.
// 1 exeption: network-games. Those can have 0 players
// But this exeption is not true for network_servers!
if (!_players[0].is_active && (!_networking || (_networking && _network_server)))
// But this exeption is not true for non dedicated network_servers! */
if (!_players[0].is_active && (!_networking || (_networking && _network_server && !_network_dedicated)))
DoStartupNewPlayer(false);
DoZoomInOutWindow(ZOOM_NONE, w); // update button status

View File

@ -989,7 +989,7 @@ static void ini_save_setting_list(IniFile *ini, const char *grpname, char **list
#define SDTG_CONDOMANY(name, type, flags, guiflags, var, def, max, full, str, proc, from, to)\
SDTG_GENERAL(name, SDT_ONEOFMANY, SL_VAR, type, flags, guiflags, var, 0, def, 0, max, 0, full, str, proc, from, to)
#define SDTG_OMANY(name, type, flags, guiflags, var, def, max, full, str, proc)\
SDTG_CONDOMANY(name, type, flags, guiflags, var, def, max full, str, proc, 0, SL_MAX_VERSION)
SDTG_CONDOMANY(name, type, flags, guiflags, var, def, max, full, str, proc, 0, SL_MAX_VERSION)
#define SDTG_CONDMMANY(name, type, flags, guiflags, var, def, full, str, proc, from, to)\
SDTG_GENERAL(name, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, var, 0, def, 0, 0, 0, full, str, proc, from, to)
@ -1240,6 +1240,7 @@ static const SettingDescGlobVarList _network_settings[] = {
SDTG_VAR("max_spectators", SLE_UINT8, S, 0, _network_game_info.spectators_max, 10, 0, 10, 0, STR_NULL, NULL),
SDTG_VAR("restart_game_year", SLE_INT32, S,D0, _network_restart_game_year, 0, MIN_YEAR, MAX_YEAR, 1, STR_NULL, NULL),
SDTG_VAR("min_players", SLE_UINT8, S, 0, _network_min_players, 0, 0, 10, 0, STR_NULL, NULL),
SDTG_OMANY("server_lang", SLE_UINT8, S, 0, _network_game_info.server_lang, 0, 3, "ANY|ENGLISH|GERMAN|FRENCH", STR_NULL, NULL),
SDTG_END()
};
#endif /* ENABLE_NETWORK */

View File

@ -1096,7 +1096,7 @@ int32 CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1, uint3
int w = plat_len;
do {
byte layout = *layout_ptr++;
MakeRailStation(tile, st->owner, st->index, axis, layout, GB(p2, 0, 4));
MakeRailStation(tile, st->owner, st->index, axis, layout & ~1, GB(p2, 0, 4));
SetCustomStationSpecIndex(tile, specindex);
SetStationTileRandomBits(tile, GB(Random(), 0, 4));
@ -1104,7 +1104,7 @@ int32 CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1, uint3
/* Use a fixed axis for GetPlatformInfo as our platforms / numtracks are always the right way around */
uint32 platinfo = GetPlatformInfo(AXIS_X, 0, plat_len, numtracks_orig, plat_len - w, numtracks_orig - numtracks, false);
uint16 callback = GetStationCallback(CBID_STATION_TILE_LAYOUT, platinfo, 0, statspec, st, tile);
if (callback != CALLBACK_FAILED && callback < 8) SetStationGfx(tile, callback + axis);
if (callback != CALLBACK_FAILED && callback < 8) SetStationGfx(tile, (callback & ~1) + axis);
}
tile += tile_delta;