(svn r13735) [0.6] -Backport from trunk:

- Fix: NewGRF rail continuation would always mark a tunnel on the same axis as connected, even when the tunnel faces the wrong direction (r13734)
- Fix: Assumption that non-north tiles of a house do not have the 1x1 building bit set was flawed with some NewGRFs. This caused the amount of houses to differ, which causes the town radii to differ, which causes desyncs when towns are expanded (r13729)
- Fix: Possible desync on the autorenew settings 20+ game years (i.e. 4.5+ hours) after a company was started (r13718)
- Fix: Any player could construct new companies [FS#2144] (r13716)
- Fix: Possible crash on creating a network packet (r13713)
- Fix: Enforce the length restrictions of company and president name in the commands too (r13712)
This commit is contained in:
rubidium
2008-07-19 12:23:14 +00:00
parent bafea078f2
commit 6097389437
12 changed files with 55 additions and 81 deletions
+4 -8
View File
@@ -225,14 +225,12 @@ static bool IsUniqueCompanyName(const char *name)
*/
CommandCost CmdChangeCompanyName(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
Player *p;
if (StrEmpty(_cmd_text)) return CMD_ERROR;
if (StrEmpty(_cmd_text) || strlen(_cmd_text) > MAX_LENGTH_COMPANY_NAME) return CMD_ERROR;
if (!IsUniqueCompanyName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
if (flags & DC_EXEC) {
p = GetPlayer(_current_player);
Player *p = GetPlayer(_current_player);
free(p->name);
p->name = strdup(_cmd_text);
MarkWholeScreenDirty();
@@ -264,14 +262,12 @@ static bool IsUniquePresidentName(const char *name)
*/
CommandCost CmdChangePresidentName(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
Player *p;
if (StrEmpty(_cmd_text)) return CMD_ERROR;
if (StrEmpty(_cmd_text) || strlen(_cmd_text) > MAX_LENGTH_PRESIDENT_NAME) return CMD_ERROR;
if (!IsUniquePresidentName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
if (flags & DC_EXEC) {
p = GetPlayer(_current_player);
Player *p = GetPlayer(_current_player);
free(p->president_name);
p->president_name = strdup(_cmd_text);