| CODENOTIFIER | HelpYou are not signed inSign in |
Project: ScummVM
Revision: 34748
Author: dreammaster
Date: 05 Oct 2008 06:25:35
Changes: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
Files:| ... | ...@@ -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 |
| ... | ...@@ -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; |