diff options
| author | Vicent Marti | 2008-10-05 20:31:18 +0000 |
|---|---|---|
| committer | Vicent Marti | 2008-10-05 20:31:18 +0000 |
| commit | 000eedb0737dbe400d016edf213928dbb1a227d3 (patch) | |
| tree | d1287ed86ca81a97075281d75f924b31d415a668 | |
| parent | 5f30b1f320ca34fa05246736d9fe074c204cdf38 (diff) | |
| parent | 03d8f7e196c5e951055da4c646c097b8219ea346 (diff) | |
| download | scummvm-rg350-000eedb0737dbe400d016edf213928dbb1a227d3.tar.gz scummvm-rg350-000eedb0737dbe400d016edf213928dbb1a227d3.tar.bz2 scummvm-rg350-000eedb0737dbe400d016edf213928dbb1a227d3.zip | |
Merged revisions 34748,34750 via svnmerge from
https://tanoku@scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk
........
r34748 | dreammaster | 2008-10-05 12:25:35 +0200 (Sun, 05 Oct 2008) | 1 line
Changed NPC schedules to be loaded when an NPC is activated - this avoids an issue with the Castle Skorl's pre-activation room number being invalid room #99
........
r34750 | fingolfin | 2008-10-05 14:18:16 +0200 (Sun, 05 Oct 2008) | 1 line
Fixed ambiguous 'else'
........
svn-id: r34752
| -rw-r--r-- | common/unarj.cpp | 4 | ||||
| -rw-r--r-- | engines/lure/res.cpp | 7 | ||||
| -rw-r--r-- | engines/lure/res_struct.cpp | 9 | ||||
| -rw-r--r-- | engines/lure/res_struct.h | 1 |
4 files changed, 12 insertions, 9 deletions
diff --git a/common/unarj.cpp b/common/unarj.cpp index 00f51ac252..9162e437da 100644 --- a/common/unarj.cpp +++ b/common/unarj.cpp @@ -146,10 +146,10 @@ int32 ArjFile::findHeader(void) { _currArchive.seek(tmp_pos, SEEK_SET); id = _currArchive.readByte(); while (tmp_pos < end_pos) { - if (id == HEADER_ID_LO) + if (id == HEADER_ID_LO) { if ((id = _currArchive.readByte()) == HEADER_ID_HI) break; - else + } else id = _currArchive.readByte(); tmp_pos++; } diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp index 68de260061..2d69c9e931 100644 --- a/engines/lure/res.cpp +++ b/engines/lure/res.cpp @@ -558,6 +558,13 @@ Hotspot *Resources::activateHotspot(uint16 hotspotId) { if (h != NULL) return h; + // If it's NPC with a schedule, then activate the schedule + if ((res->npcScheduleId != 0) && (res->npcSchedule.isEmpty())) { + Resources &resources = Resources::getReference(); + CharacterScheduleEntry *entry = resources.charSchedules().getEntry(res->npcScheduleId); + res->npcSchedule.addFront(DISPATCH_ACTION, entry, res->roomNumber); + } + // Check the script load flag if (res->scriptLoadFlag) { // Execute a script rather than doing a standard load diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp index 92cea948f9..1c4fe883d0 100644 --- a/engines/lure/res_struct.cpp +++ b/engines/lure/res_struct.cpp @@ -434,13 +434,8 @@ HotspotData::HotspotData(HotspotResource *rec) { talkGate = 0; scriptHotspotId = 0; - // Set up NPC schedule if any - uint16 npcScheduleId = READ_LE_UINT16(&rec->npcSchedule); - if (npcScheduleId != 0) { - Resources &res = Resources::getReference(); - CharacterScheduleEntry *entry = res.charSchedules().getEntry(npcScheduleId); - npcSchedule.addFront(DISPATCH_ACTION, entry, roomNumber); - } + // Get the NPC schedule, if any + npcScheduleId = READ_LE_UINT16(&rec->npcSchedule); } void HotspotData::saveToStream(WriteStream *stream) { diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h index e2f596292b..684ce5aa17 100644 --- a/engines/lure/res_struct.h +++ b/engines/lure/res_struct.h @@ -543,6 +543,7 @@ public: uint16 delayCtr; uint8 flags2; uint8 headerFlags; + uint16 npcScheduleId; // Runtime fields uint16 actionCtr; |
