From 9ac46607fc794a4a3514664cd587ccecfc12ad3b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 16 Feb 2008 05:12:32 +0000 Subject: Bugfix for loading older savegame versions svn-id: r30879 --- engines/lure/res_struct.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/lure/res_struct.cpp') diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp index 8ce8a14f69..0903586c98 100644 --- a/engines/lure/res_struct.cpp +++ b/engines/lure/res_struct.cpp @@ -1220,9 +1220,11 @@ void BarmanLists::loadFromStream(Common::ReadStream *stream) { uint8 saveVersion = LureEngine::getReference().saveVersion(); int numEntries = (saveVersion >= 30) ? 3 : 2; + reset(); for (int index = 0; index < numEntries; ++index) { int16 value = stream->readUint16LE(); - _barList[index].currentCustomer = (value == 0) ? NULL : &_barList[index].customers[value - 1]; + _barList[index].currentCustomer = ((value < 1) || (value > NUM_SERVE_CUSTOMERS)) ? NULL : + &_barList[index].customers[value - 1]; for (int ctr = 0; ctr < NUM_SERVE_CUSTOMERS; ++ctr) { _barList[index].customers[ctr].hotspotId = stream->readUint16LE(); -- cgit v1.2.3