PARALLACTION: Fix invalid array access at dialogue selection
Also removes an unnecessary second condition check for oldAnswer by moving that closer to its point of use.
This commit is contained in:
parent
65b108b4cf
commit
8f7f7a9c2b
1 changed files with 2 additions and 3 deletions
|
@ -253,15 +253,14 @@ int16 DialogueManager::selectAnswerN() {
|
|||
|
||||
_selection = _balloonMan->hitTestDialogueBalloon(_mousePos.x, _mousePos.y);
|
||||
|
||||
VisibleAnswer *oldAnswer = (_oldSelection == NO_ANSWER_SELECTED) ? NULL : &_visAnswers[_oldSelection];
|
||||
VisibleAnswer *answer = &_visAnswers[_selection];
|
||||
|
||||
if (_selection != _oldSelection) {
|
||||
if (_oldSelection != NO_ANSWER_SELECTED) {
|
||||
VisibleAnswer *oldAnswer = &_visAnswers[_oldSelection];
|
||||
_balloonMan->setBalloonText(oldAnswer->_balloon, oldAnswer->_a->_text, BalloonManager::kUnselectedColor);
|
||||
}
|
||||
|
||||
if (_selection != NO_ANSWER_SELECTED) {
|
||||
VisibleAnswer *answer = &_visAnswers[_selection];
|
||||
_balloonMan->setBalloonText(answer->_balloon, answer->_a->_text, BalloonManager::kSelectedColor);
|
||||
_gfx->setItemFrame(_faceId, answer->_a->speakerMood());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue