[Scummvm-cvs-logs] SF.net SVN: scummvm:[34748] scummvm/trunk/engines/lure
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Sun Oct 5 12:25:35 CEST 2008
Revision: 34748
http://scummvm.svn.sourceforge.net/scummvm/?rev=34748&view=rev
Author: dreammaster
Date: 2008-10-05 10:25:35 +0000 (Sun, 05 Oct 2008)
Log Message:
-----------
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
Modified Paths:
--------------
scummvm/trunk/engines/lure/res.cpp
scummvm/trunk/engines/lure/res_struct.cpp
scummvm/trunk/engines/lure/res_struct.h
Modified: scummvm/trunk/engines/lure/res.cpp
===================================================================
--- scummvm/trunk/engines/lure/res.cpp 2008-10-05 10:19:09 UTC (rev 34747)
+++ scummvm/trunk/engines/lure/res.cpp 2008-10-05 10:25:35 UTC (rev 34748)
@@ -558,6 +558,13 @@
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
Modified: scummvm/trunk/engines/lure/res_struct.cpp
===================================================================
--- scummvm/trunk/engines/lure/res_struct.cpp 2008-10-05 10:19:09 UTC (rev 34747)
+++ scummvm/trunk/engines/lure/res_struct.cpp 2008-10-05 10:25:35 UTC (rev 34748)
@@ -434,13 +434,8 @@
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) {
Modified: scummvm/trunk/engines/lure/res_struct.h
===================================================================
--- scummvm/trunk/engines/lure/res_struct.h 2008-10-05 10:19:09 UTC (rev 34747)
+++ scummvm/trunk/engines/lure/res_struct.h 2008-10-05 10:25:35 UTC (rev 34748)
@@ -543,6 +543,7 @@
uint16 delayCtr;
uint8 flags2;
uint8 headerFlags;
+ uint16 npcScheduleId;
// Runtime fields
uint16 actionCtr;
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