Bugfix for reactivating an NPC when it was previously deactivated at precisely the moment when it was about to do a pathfinding

svn-id: r46189
This commit is contained in:
Paul Gilbert 2009-11-29 09:02:02 +00:00
parent 2e4aca24f2
commit e3d354f63c

View File

@ -656,6 +656,11 @@ Hotspot *Resources::addHotspot(uint16 hotspotId) {
// Default characters to facing upwards until they start moving
hotspot->setDirection(UP);
hotspot->setCharRectY(0);
// When reactivating an NPC, ensure that their previous state wasn't PROCESSING_PATH, since
// the pause has destroyed the previously decided destination position
if (!hData->npcSchedule.isEmpty() && (hData->npcSchedule.top().action() == PROCESSING_PATH))
hData->npcSchedule.top().setAction(DISPATCH_ACTION);
}
return hotspot;