(svn r20211) -Codechange: Indented code should have curly braces around it.

This commit is contained in:
alberth
2010-07-24 10:14:39 +00:00
parent 3dc9989841
commit 137e2b64c9
49 changed files with 206 additions and 177 deletions

View File

@@ -638,8 +638,9 @@ bool AfterLoadGame()
* a company does not exist yet. So create one here.
* 1 exeption: network-games. Those can have 0 companies
* But this exeption is not true for non dedicated network_servers! */
if (!Company::IsValidID(COMPANY_FIRST) && (!_networking || (_networking && _network_server && !_network_dedicated)))
if (!Company::IsValidID(COMPANY_FIRST) && (!_networking || (_networking && _network_server && !_network_dedicated))) {
DoStartupNewCompany(false);
}
/* Fix the cache for cargo payments. */
CargoPayment *cp;

View File

@@ -993,8 +993,9 @@ static bool LoadOldCompany(LoadgameState *ls, int num)
if (num == 0) {
/* If the first company has no name, make sure we call it UNNAMED */
if (c->name_1 == 0)
if (c->name_1 == 0) {
c->name_1 = STR_SV_UNNAMED;
}
} else {
/* Beside some multiplayer maps (1 on 1), which we don't official support,
* all other companys are an AI.. mark them as such */

View File

@@ -409,8 +409,9 @@ static uint SlReadSimpleGamma()
i &= ~0x40;
if (HasBit(i, 5)) {
i &= ~0x20;
if (HasBit(i, 4))
if (HasBit(i, 4)) {
SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_SAVEGAME, "Unsupported gamma");
}
i = (i << 8) | SlReadByte();
}
i = (i << 8) | SlReadByte();
@@ -538,8 +539,9 @@ void SlSetLength(size_t length)
break;
case CH_ARRAY:
assert(_sl.last_array_index <= _sl.array_index);
while (++_sl.last_array_index <= _sl.array_index)
while (++_sl.last_array_index <= _sl.array_index) {
SlWriteArrayLength(1);
}
SlWriteArrayLength(length + 1);
break;
case CH_SPARSE_ARRAY:
@@ -1520,8 +1522,7 @@ static size_t ReadZlib()
/* inflate the data */
r = inflate(&_z, 0);
if (r == Z_STREAM_END)
break;
if (r == Z_STREAM_END) break;
if (r != Z_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "inflate() failed");
} while (_z.avail_out);
@@ -1569,8 +1570,8 @@ static void WriteZlibLoop(z_streamp z, byte *p, size_t len, int mode)
if ((n = sizeof(buf) - z->avail_out) != 0) {
if (fwrite(buf, n, 1, _sl.fh) != 1) SlError(STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE);
}
if (r == Z_STREAM_END)
break;
if (r == Z_STREAM_END) break;
if (r != Z_OK) SlError(STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR, "zlib returned error code");
} while (z->avail_in || !z->avail_out);
}

View File

@@ -733,8 +733,9 @@ void Load_VEHS()
}
/* Old savegames used 'last_station_visited = 0xFF' */
if (CheckSavegameVersion(5) && v->last_station_visited == 0xFF)
if (CheckSavegameVersion(5) && v->last_station_visited == 0xFF) {
v->last_station_visited = INVALID_STATION;
}
if (CheckSavegameVersion(5)) {
/* Convert the current_order.type (which is a mix of type and flags, because