aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/pink/items/sequence_item.cpp4
-rw-r--r--engines/pink/sequences/sequence.cpp10
-rw-r--r--engines/pink/sequences/sequencer.cpp4
-rw-r--r--engines/pink/sequences/sequencer.h1
4 files changed, 16 insertions, 3 deletions
diff --git a/engines/pink/items/sequence_item.cpp b/engines/pink/items/sequence_item.cpp
index 050e1d0d4b..2a8a93f4a5 100644
--- a/engines/pink/items/sequence_item.cpp
+++ b/engines/pink/items/sequence_item.cpp
@@ -23,11 +23,15 @@
#include <common/debug.h>
#include "sequence_item.h"
#include "../archive.h"
+#include "sequence_item_leader.h"
+#include "sequence_item_default_action.h"
namespace Pink {
void SequenceItem::deserialize(Archive &archive) {
archive >> _actor >> _action;
+ if (!dynamic_cast<SequenceItemLeader*>(this) && !dynamic_cast<SequenceItemDefaultAction*>(this))
+ debug("\t\tSequenceItem: _actor = %s, _action = %s", _actor.c_str(), _action.c_str());
}
const Common::String &SequenceItem::getActor() const {
diff --git a/engines/pink/sequences/sequence.cpp b/engines/pink/sequences/sequence.cpp
index 73f1194c3c..0d8adc1ac4 100644
--- a/engines/pink/sequences/sequence.cpp
+++ b/engines/pink/sequences/sequence.cpp
@@ -44,13 +44,17 @@ SequenceContext::SequenceContext(Sequence *sequence, Sequencer *sequencer)
{
Common::Array<SequenceItem*> &items = sequence->getItems();
for (uint i = 0; i < items.size(); ++i) {
+ bool found = 0;
for (uint j = 0; j < _states.size(); ++j) {
- if (items[i]->getActor() != _states[j].getActor()){
+ if (items[i]->getActor() == _states[j].getActor()){
+ found = 1;
break;
}
- else assert(0); // can it be ?
}
- _states.push_back({items[i]->getActor()});
+ if (!found) {
+ debug(items[i]->getActor().c_str());
+ _states.push_back({items[i]->getActor()});
+ }
}
}
diff --git a/engines/pink/sequences/sequencer.cpp b/engines/pink/sequences/sequencer.cpp
index 4f7099fdfc..68b72c1ecd 100644
--- a/engines/pink/sequences/sequencer.cpp
+++ b/engines/pink/sequences/sequencer.cpp
@@ -54,7 +54,11 @@ void Sequencer::authorSequence(Sequence *sequence, bool unk) {
if (sequence){
_context = new SequenceContext(sequence, this);
+ //unload array of unknown objects
+ _currentSequenceName = sequence->getName();
+
}
+ else _currentSequenceName.clear();
}
} // End of namespace Pink \ No newline at end of file
diff --git a/engines/pink/sequences/sequencer.h b/engines/pink/sequences/sequencer.h
index 255f2c63ed..e2d16cdea9 100644
--- a/engines/pink/sequences/sequencer.h
+++ b/engines/pink/sequences/sequencer.h
@@ -45,6 +45,7 @@ private:
SequenceContext *_context;
// unknown objects array
Common::Array<Sequence*> _sequences;
+ Common::String _currentSequenceName;
//timers
GamePage *_page;
};