diff options
author | Paul Gilbert | 2017-08-13 19:03:54 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-08-13 19:03:54 -0400 |
commit | ad43619b7edc14e407c2eb0cc2df6201edf1ab86 (patch) | |
tree | eeb56ab15fb1ad453b465f682de61487a4a6a92c /engines/titanic/npcs | |
parent | 0bdb969b5bf2f25f2b5476119ae968939de0773a (diff) | |
download | scummvm-rg350-ad43619b7edc14e407c2eb0cc2df6201edf1ab86.tar.gz scummvm-rg350-ad43619b7edc14e407c2eb0cc2df6201edf1ab86.tar.bz2 scummvm-rg350-ad43619b7edc14e407c2eb0cc2df6201edf1ab86.zip |
TITANIC: Stop SuccUBus turning on when dragging mail
Diffstat (limited to 'engines/titanic/npcs')
-rw-r--r-- | engines/titanic/npcs/succubus.cpp | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/engines/titanic/npcs/succubus.cpp b/engines/titanic/npcs/succubus.cpp index 1fe02426a5..6eeccd345a 100644 --- a/engines/titanic/npcs/succubus.cpp +++ b/engines/titanic/npcs/succubus.cpp @@ -226,32 +226,39 @@ void CSuccUBus::load(SimpleFile *file) { } bool CSuccUBus::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { - if (!_inProgress) { - Rect tempRect = _rect1; - tempRect.translate(_bounds.left, _bounds.top); - - if (!_isOn || (_mailPresent && tempRect.contains(msg->_mousePos))) { - CTurnOn onMsg; - onMsg.execute(this); - _isOn = true; - } else if (getRandomNumber(256) < 130) { - _isOn = false; - CTurnOff offMsg; - offMsg.execute(this); - } else { - switch (getRandomNumber(2, &_priorRandomVal1)) { - case 0: - startTalking(this, 230055, findView()); - break; - case 1: - startTalking(this, 230067, findView()); - break; - case 2: - startTalking(this, 230045, findView()); - break; - default: - break; - } + if (_inProgress) + return true; + + Rect tempRect = _rect1; + tempRect.translate(_bounds.left, _bounds.top); + + if (!_isOn) { + CTurnOn onMsg; + onMsg.execute(this); + _isOn = true; + return true; + } + + if (_mailPresent && tempRect.contains(msg->_mousePos)) + return true; + + if (getRandomNumber(256) < 130) { + _isOn = false; + CTurnOff offMsg; + offMsg.execute(this); + } else { + switch (getRandomNumber(2, &_priorRandomVal1)) { + case 0: + startTalking(this, 230055, findView()); + break; + case 1: + startTalking(this, 230067, findView()); + break; + case 2: + startTalking(this, 230045, findView()); + break; + default: + break; } } |