[Scummvm-cvs-logs] SF.net SVN: scummvm: [30365] scummvm/trunk/engines/lure/res_struct.cpp
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Thu Jan 10 10:22:47 CET 2008
Revision: 30365
http://scummvm.svn.sourceforge.net/scummvm/?rev=30365&view=rev
Author: dreammaster
Date: 2008-01-10 01:22:46 -0800 (Thu, 10 Jan 2008)
Log Message:
-----------
Bugfix for incorrect data being saved for the current NPC the barmen are serving
Modified Paths:
--------------
scummvm/trunk/engines/lure/res_struct.cpp
Modified: scummvm/trunk/engines/lure/res_struct.cpp
===================================================================
--- scummvm/trunk/engines/lure/res_struct.cpp 2008-01-09 23:00:54 UTC (rev 30364)
+++ scummvm/trunk/engines/lure/res_struct.cpp 2008-01-10 09:22:46 UTC (rev 30365)
@@ -1162,7 +1162,8 @@
void BarmanLists::saveToStream(Common::WriteStream *stream) {
for (int index = 0; index < 2; ++index) {
- uint16 value = (_barList[index].currentCustomer - &_barList[index].customers[0]) / sizeof(BarEntry);
+ uint16 value = (_barList[index].currentCustomer == NULL) ? 0 :
+ (_barList[index].currentCustomer - &_barList[index].customers[0]) / sizeof(BarEntry) + 1;
stream->writeUint16LE(value);
for (int ctr = 0; ctr < NUM_SERVE_CUSTOMERS; ++ctr) {
stream->writeUint16LE(_barList[index].customers[ctr].hotspotId);
@@ -1174,7 +1175,7 @@
void BarmanLists::loadFromStream(Common::ReadStream *stream) {
for (int index = 0; index < 2; ++index) {
int16 value = stream->readUint16LE();
- _barList[index].currentCustomer = (value == 0) ? NULL : &_barList[index].customers[value];
+ _barList[index].currentCustomer = (value == 0) ? NULL : &_barList[index].customers[value - 1];
for (int ctr = 0; ctr < NUM_SERVE_CUSTOMERS; ++ctr) {
_barList[index].customers[ctr].hotspotId = stream->readUint16LE();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list