From b35c5cba3938e8aef21fb64c52a41654882d1398 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 3 Mar 2019 21:52:57 -0800 Subject: ACCESS: AMAZON: Fix crash due to Common::Language change Thanks to eriktorbjorn for noticing a new addition to the Common::Language enum was breaking the game --- engines/access/resources.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'engines/access') diff --git a/engines/access/resources.cpp b/engines/access/resources.cpp index a7b23eb56d..2b7f1aa8f3 100644 --- a/engines/access/resources.cpp +++ b/engines/access/resources.cpp @@ -70,7 +70,20 @@ bool Resources::load(Common::String &errorMessage) { _datIndex[idx]._gameId = f.readByte(); _datIndex[idx]._discType = f.readByte(); _datIndex[idx]._demoType = f.readByte(); - _datIndex[idx]._language = (Common::Language)f.readByte(); + + byte language = f.readByte(); + switch (language) { + case 0: + _datIndex[idx]._language = (Common::Language)0; + break; + case 5: + _datIndex[idx]._language = Common::EN_ANY; + break; + default: + error("Unknown language"); + break; + } + _datIndex[idx]._fileOffset = f.readUint32LE(); } -- cgit v1.2.3