MADS: Fix crash if you talk to intern in gurney room too quickly
This commit is contained in:
parent
82faf6b50d
commit
d23e493b46
3 changed files with 23 additions and 3 deletions
|
@ -144,7 +144,7 @@ int SequenceList::add(int spriteListIndex, bool flipped, int frameIndex, int tri
|
|||
return seqIndex;
|
||||
}
|
||||
|
||||
int SequenceList::addTimer(int timeout, int abortVal) {
|
||||
int SequenceList::addTimer(int timeout, int endTrigger) {
|
||||
Scene &scene = _vm->_game->_scene;
|
||||
uint seqIndex;
|
||||
for (seqIndex = 0; seqIndex < _entries.size(); ++seqIndex) {
|
||||
|
@ -164,7 +164,7 @@ int SequenceList::addTimer(int timeout, int abortVal) {
|
|||
se._entries._count = 0;
|
||||
se._triggerMode = _vm->_game->_triggerSetupMode;
|
||||
se._actionNouns = _vm->_game->_scene._action._activeAction;
|
||||
addSubEntry(seqIndex, SEQUENCE_TRIGGER_EXPIRE, 0, abortVal);
|
||||
addSubEntry(seqIndex, SEQUENCE_TRIGGER_EXPIRE, 0, endTrigger);
|
||||
|
||||
return seqIndex;
|
||||
}
|
||||
|
@ -181,6 +181,19 @@ void SequenceList::remove(int seqIndex) {
|
|||
scene._spriteSlots.deleteTimer(seqIndex);
|
||||
}
|
||||
|
||||
int SequenceList::findByTrigger(int trigger) {
|
||||
for (int idx = 0; idx < _entries.size(); ++idx) {
|
||||
if (_entries[idx]._active) {
|
||||
for (uint subIdx = 0; subIdx < _entries[idx]._entries._count; ++subIdx) {
|
||||
if (_entries[idx]._entries._trigger[subIdx] == trigger)
|
||||
return idx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void SequenceList::setSpriteSlot(int seqIndex, SpriteSlot &spriteSlot) {
|
||||
Scene &scene = _vm->_game->_scene;
|
||||
SequenceEntry &timerEntry = _entries[seqIndex];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue