[Scummvm-cvs-logs] SF.net SVN: scummvm:[34753] scummvm/branches/branch-0-12-0/engines/lure
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Mon Oct 6 11:16:28 CEST 2008
Revision: 34753
http://scummvm.svn.sourceforge.net/scummvm/?rev=34753&view=rev
Author: dreammaster
Date: 2008-10-06 09:16:26 +0000 (Mon, 06 Oct 2008)
Log Message:
-----------
Backport of commits r34748 and r34737 - Bugfix for NPCs walking beyond room exits, and fix for NPC schedule loading for Castle Skorl
Modified Paths:
--------------
scummvm/branches/branch-0-12-0/engines/lure/hotspots.cpp
scummvm/branches/branch-0-12-0/engines/lure/res.cpp
scummvm/branches/branch-0-12-0/engines/lure/res_struct.cpp
scummvm/branches/branch-0-12-0/engines/lure/res_struct.h
Modified: scummvm/branches/branch-0-12-0/engines/lure/hotspots.cpp
===================================================================
--- scummvm/branches/branch-0-12-0/engines/lure/hotspots.cpp 2008-10-05 20:31:18 UTC (rev 34752)
+++ scummvm/branches/branch-0-12-0/engines/lure/hotspots.cpp 2008-10-06 09:16:26 UTC (rev 34753)
@@ -2760,11 +2760,11 @@
// Walking done
h.currentActions().top().setAction(DISPATCH_ACTION);
- if (h.destHotspotId() != 0) {
+// if (h.destHotspotId() != 0) {
// Walking to an exit, check for any required room change
if (Support::checkRoomChange(h))
break;
- }
+// }
}
h.setOccupied(true);
Modified: scummvm/branches/branch-0-12-0/engines/lure/res.cpp
===================================================================
--- scummvm/branches/branch-0-12-0/engines/lure/res.cpp 2008-10-05 20:31:18 UTC (rev 34752)
+++ scummvm/branches/branch-0-12-0/engines/lure/res.cpp 2008-10-06 09:16:26 UTC (rev 34753)
@@ -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/branches/branch-0-12-0/engines/lure/res_struct.cpp
===================================================================
--- scummvm/branches/branch-0-12-0/engines/lure/res_struct.cpp 2008-10-05 20:31:18 UTC (rev 34752)
+++ scummvm/branches/branch-0-12-0/engines/lure/res_struct.cpp 2008-10-06 09:16:26 UTC (rev 34753)
@@ -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/branches/branch-0-12-0/engines/lure/res_struct.h
===================================================================
--- scummvm/branches/branch-0-12-0/engines/lure/res_struct.h 2008-10-05 20:31:18 UTC (rev 34752)
+++ scummvm/branches/branch-0-12-0/engines/lure/res_struct.h 2008-10-06 09:16:26 UTC (rev 34753)
@@ -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