mirror of https://github.com/OpenTTD/OpenTTD
(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
parent
c50cf74889
commit
3a195edcad
|
@ -1397,11 +1397,13 @@ void NetworkStartUp(void)
|
||||||
byte cl_max = _network_game_info.clients_max;
|
byte cl_max = _network_game_info.clients_max;
|
||||||
byte cp_max = _network_game_info.companies_max;
|
byte cp_max = _network_game_info.companies_max;
|
||||||
byte sp_max = _network_game_info.spectators_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));
|
memset(&_network_game_info, 0, sizeof(_network_game_info));
|
||||||
_network_game_info.clients_max = cl_max;
|
_network_game_info.clients_max = cl_max;
|
||||||
_network_game_info.companies_max = cp_max;
|
_network_game_info.companies_max = cp_max;
|
||||||
_network_game_info.spectators_max = sp_max;
|
_network_game_info.spectators_max = sp_max;
|
||||||
|
_network_game_info.server_lang = s_lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Let's load the network in windows
|
// Let's load the network in windows
|
||||||
|
|
6
newgrf.c
6
newgrf.c
|
@ -2096,11 +2096,6 @@ static void FeatureNewName(byte *buf, int len)
|
||||||
|
|
||||||
len -= (int)name_length;
|
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);
|
DEBUG(grf, 8) ("FeatureNewName: %d <- %s", id, name);
|
||||||
|
|
||||||
switch (feature) {
|
switch (feature) {
|
||||||
|
@ -2171,7 +2166,6 @@ static void FeatureNewName(byte *buf, int len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Action 0x05 */
|
/* Action 0x05 */
|
||||||
static void GraphicsNew(byte *buf, int len)
|
static void GraphicsNew(byte *buf, int len)
|
||||||
|
|
|
@ -118,10 +118,10 @@ static inline usize EvalAdjust_ ## size(const DeterministicSpriteGroupAdjust *ad
|
||||||
case DSGA_OP_SMAX: return max(last_value, value); \
|
case DSGA_OP_SMAX: return max(last_value, value); \
|
||||||
case DSGA_OP_UMIN: return min((usize)last_value, (usize)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_UMAX: return max((usize)last_value, (usize)value); \
|
||||||
case DSGA_OP_SDIV: return last_value / value; \
|
case DSGA_OP_SDIV: return value == 0 ? last_value : last_value / value; \
|
||||||
case DSGA_OP_SMOD: return last_value % value; \
|
case DSGA_OP_SMOD: return value == 0 ? last_value : last_value % value; \
|
||||||
case DSGA_OP_UDIV: return (usize)last_value / (usize)value; \
|
case DSGA_OP_UDIV: return value == 0 ? (usize)last_value : (usize)last_value / (usize)value; \
|
||||||
case DSGA_OP_UMOD: return (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_MUL: return last_value * value; \
|
||||||
case DSGA_OP_AND: return last_value & value; \
|
case DSGA_OP_AND: return last_value & value; \
|
||||||
case DSGA_OP_OR: return last_value | value; \
|
case DSGA_OP_OR: return last_value | value; \
|
||||||
|
|
|
@ -1242,8 +1242,8 @@ bool AfterLoadGame(void)
|
||||||
// If Load Scenario / New (Scenario) Game is used,
|
// If Load Scenario / New (Scenario) Game is used,
|
||||||
// a player does not exist yet. So create one here.
|
// a player does not exist yet. So create one here.
|
||||||
// 1 exeption: network-games. Those can have 0 players
|
// 1 exeption: network-games. Those can have 0 players
|
||||||
// But this exeption is not true for network_servers!
|
// But this exeption is not true for non dedicated network_servers! */
|
||||||
if (!_players[0].is_active && (!_networking || (_networking && _network_server)))
|
if (!_players[0].is_active && (!_networking || (_networking && _network_server && !_network_dedicated)))
|
||||||
DoStartupNewPlayer(false);
|
DoStartupNewPlayer(false);
|
||||||
|
|
||||||
DoZoomInOutWindow(ZOOM_NONE, w); // update button status
|
DoZoomInOutWindow(ZOOM_NONE, w); // update button status
|
||||||
|
|
|
@ -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)\
|
#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)
|
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)\
|
#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)\
|
#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)
|
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("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("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_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()
|
SDTG_END()
|
||||||
};
|
};
|
||||||
#endif /* ENABLE_NETWORK */
|
#endif /* ENABLE_NETWORK */
|
||||||
|
|
|
@ -1096,7 +1096,7 @@ int32 CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1, uint3
|
||||||
int w = plat_len;
|
int w = plat_len;
|
||||||
do {
|
do {
|
||||||
byte layout = *layout_ptr++;
|
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);
|
SetCustomStationSpecIndex(tile, specindex);
|
||||||
SetStationTileRandomBits(tile, GB(Random(), 0, 4));
|
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 */
|
/* 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);
|
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);
|
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;
|
tile += tile_delta;
|
||||||
|
|
Loading…
Reference in New Issue