mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 20:12:42 +00:00
(svn r22747) [1.1] -Backport from trunk:
- Fix: Some corrupted savegames could crash OpenTTD instead of showing the 'savegame corrupted' message [FS#4717] (r22737, r22736) - Fix: Triggering NOT_REACHED when playing with a NewGRF that supplies genders/cases for a language that was not installed [FS#4718] (r22735)
This commit is contained in:
@@ -32,6 +32,8 @@ static void Load_CHTS()
|
||||
{
|
||||
Cheat *cht = (Cheat*)&_cheats;
|
||||
size_t count = SlGetFieldLength() / 2;
|
||||
/* Cannot use lengthof because _cheats is of type Cheats, not Cheat */
|
||||
if (count > sizeof(_cheats) / sizeof(Cheat)) SlErrorCorrupt("Too many cheat values");
|
||||
|
||||
for (uint i = 0; i < count; i++) {
|
||||
cht[i].been_used = (SlReadByte() != 0);
|
||||
|
||||
Reference in New Issue
Block a user