diff options
author | whiterandrek | 2018-06-02 22:06:10 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | b682ecb0ea63906b0ad1f735031a9f800d535eb8 (patch) | |
tree | 42acc6f5591c012d21c2ca960b96fee82f9f97a7 /engines/pink/objects/sequences | |
parent | a531381f2b80aa8f0bf8c10610eaad6a3256415f (diff) | |
download | scummvm-rg350-b682ecb0ea63906b0ad1f735031a9f800d535eb8.tar.gz scummvm-rg350-b682ecb0ea63906b0ad1f735031a9f800d535eb8.tar.bz2 scummvm-rg350-b682ecb0ea63906b0ad1f735031a9f800d535eb8.zip |
PINK: refactor Actors to remove casts and improve readability
Diffstat (limited to 'engines/pink/objects/sequences')
-rw-r--r-- | engines/pink/objects/sequences/seq_timer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/pink/objects/sequences/seq_timer.cpp b/engines/pink/objects/sequences/seq_timer.cpp index 5026051b33..95fe53ba67 100644 --- a/engines/pink/objects/sequences/seq_timer.cpp +++ b/engines/pink/objects/sequences/seq_timer.cpp @@ -46,14 +46,15 @@ void SeqTimer::toConsole() { } void SeqTimer::update() { - Common::RandomSource &rnd =_sequencer->_page->getGame()->getRnd(); + Common::RandomSource &rnd = _sequencer->_page->getGame()->getRnd(); if (_updatesToMessage--) return; _updatesToMessage = _range ? _period + rnd.getRandomNumber(_range) : _period; - SupportingActor *actor = static_cast<SupportingActor*>(_sequencer->_page->findActor(_actor)); - if (actor && !_sequencer->findSequenceActorState(actor->getName())) { + Actor *actor = _sequencer->_page->findActor(_actor); + assert(actor); + if (!_sequencer->findSequenceActorState(actor->getName())) { actor->onTimerMessage(); } } |