Skip to content

Commit

Permalink
TITANIC: Stop SuccUBus turning on when dragging mail
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Aug 13, 2017
1 parent 0bdb969 commit ad43619
Showing 1 changed file with 33 additions and 26 deletions.
59 changes: 33 additions & 26 deletions engines/titanic/npcs/succubus.cpp
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit ad43619

Please sign in to comment.