| CODENOTIFIER | HelpYou are not signed inSign in |
Project: ScummVM
Revision: 34752
Author: tanoku
Date: 05 Oct 2008 16:31:18
Changes: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'
........
| ... | ...@@ -434,13 +434,8 @@ | |
| 434 | 434 | talkGate = 0; |
| 435 | 435 | scriptHotspotId = 0; |
| 436 | 436 | |
| 437 | // Set up NPC schedule if any | |
| 438 | uint16 npcScheduleId = READ_LE_UINT16(&rec->npcSchedule); | |
| 439 | if (npcScheduleId != 0) { | |
| 440 | Resources &res = Resources::getReference(); | |
| 441 | CharacterScheduleEntry *entry = res.charSchedules().getEntry(npcScheduleId); | |
| 442 | npcSchedule.addFront(DISPATCH_ACTION, entry, roomNumber); | |
| 443 | } | |
| 437 | // Get the NPC schedule, if any | |
| 438 | npcScheduleId = READ_LE_UINT16(&rec->npcSchedule); | |
| 444 | 439 | } |
| 445 | 440 | |
| 446 | 441 | void HotspotData::saveToStream(WriteStream *stream) { |
| ... | ...@@ -543,6 +543,7 @@ | |
| 543 | 543 | uint16 delayCtr; |
| 544 | 544 | uint8 flags2; |
| 545 | 545 | uint8 headerFlags; |
| 546 | uint16 npcScheduleId; | |
| 546 | 547 | |
| 547 | 548 | // Runtime fields |
| 548 | 549 | uint16 actionCtr; |
| ... | ...@@ -146,10 +146,10 @@ | |
| 146 | 146 | _currArchive.seek(tmp_pos, SEEK_SET); |
| 147 | 147 | id = _currArchive.readByte(); |
| 148 | 148 | while (tmp_pos < end_pos) { |
| 149 | if (id == HEADER_ID_LO) | |
| 149 | if (id == HEADER_ID_LO) { | |
| 150 | 150 | if ((id = _currArchive.readByte()) == HEADER_ID_HI) |
| 151 | 151 | break; |
| 152 | else | |
| 152 | } else | |
| 153 | 153 | id = _currArchive.readByte(); |
| 154 | 154 | tmp_pos++; |
| 155 | 155 | } |
| ... | ...@@ -558,6 +558,13 @@ | |
| 558 | 558 | if (h != NULL) |
| 559 | 559 | return h; |
| 560 | 560 | |
| 561 | // If it's NPC with a schedule, then activate the schedule | |
| 562 | if ((res->npcScheduleId != 0) && (res->npcSchedule.isEmpty())) { | |
| 563 | Resources &resources = Resources::getReference(); | |
| 564 | CharacterScheduleEntry *entry = resources.charSchedules().getEntry(res->npcScheduleId); | |
| 565 | res->npcSchedule.addFront(DISPATCH_ACTION, entry, res->roomNumber); | |
| 566 | } | |
| 567 | ||
| 561 | 568 | // Check the script load flag |
| 562 | 569 | if (res->scriptLoadFlag) { |
| 563 | 570 | // Execute a script rather than doing a standard load |