mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-26 12:48:16 +00:00
AVALANCHE: Fix some more issues reported by pvs-studio
This commit is contained in:
parent
0b809f4339
commit
a926741308
@ -79,6 +79,8 @@ AnimationType::AnimationType(Animation *anim) {
|
||||
_fgBubbleCol = kColorWhite;
|
||||
_bgBubbleCol = kColorBlack;
|
||||
_id = 177;
|
||||
_oldX[0] = _oldX[1] = 0;
|
||||
_oldY[0] = _oldY[1] = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -167,7 +167,7 @@ bool Help::handleMouse(const Common::Event &event) {
|
||||
mousePos.x = event.mouse.x;
|
||||
mousePos.y = event.mouse.y / 2;
|
||||
|
||||
int index = -1;
|
||||
int index;
|
||||
|
||||
if (event.type == Common::EVENT_LBUTTONUP) { // Clicked *somewhere*...
|
||||
_holdLeft = false;
|
||||
@ -178,6 +178,7 @@ bool Help::handleMouse(const Common::Event &event) {
|
||||
index = ((mousePos.y - 13) / 27) - 1;
|
||||
} else { // LBUTTONDOWN or MOUSEMOVE
|
||||
int highlightIs = 0;
|
||||
index = -1;
|
||||
|
||||
// Decide which button we are hovering the cursor over:
|
||||
if ((mousePos.x > 470) && (mousePos.x <= 550) && (((mousePos.y - 13) % 27) <= 20)) { // No click, so highlight.
|
||||
@ -208,12 +209,11 @@ bool Help::handleMouse(const Common::Event &event) {
|
||||
if ((index >= 0) && (_buttons[index]._trigger != Common::KEYCODE_INVALID)) {
|
||||
if (_buttons[index]._trigger == Common::KEYCODE_ESCAPE)
|
||||
return true;
|
||||
else {
|
||||
_vm->fadeOut();
|
||||
switchPage(_buttons[index]._whither);
|
||||
_vm->fadeIn();
|
||||
return false;
|
||||
}
|
||||
|
||||
_vm->fadeOut();
|
||||
switchPage(_buttons[index]._whither);
|
||||
_vm->fadeIn();
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -34,6 +34,12 @@ namespace Avalanche {
|
||||
|
||||
HighScore::HighScore(AvalancheEngine *vm) {
|
||||
_vm = vm;
|
||||
|
||||
for (int i = 0; i < 12; ++i) {
|
||||
_data[i]._name = "";
|
||||
_data[i]._rank = "";
|
||||
_data[i]._score = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void HighScore::displayHighScores() {
|
||||
|
@ -280,6 +280,7 @@ bool Nim::checkInput() {
|
||||
if (_number > 1)
|
||||
_number--;
|
||||
return false;
|
||||
case Common::KEYCODE_END:
|
||||
case Common::KEYCODE_1:
|
||||
_number = 1;
|
||||
return false;
|
||||
@ -308,9 +309,6 @@ bool Nim::checkInput() {
|
||||
case Common::KEYCODE_HOME:
|
||||
_number = _stones[_row];
|
||||
return false;
|
||||
case Common::KEYCODE_END:
|
||||
_number = 1;
|
||||
return false;
|
||||
case Common::KEYCODE_UP:
|
||||
_row--;
|
||||
if (_row < 0)
|
||||
|
@ -54,6 +54,9 @@ Parser::Parser(AvalancheEngine *vm) {
|
||||
_alcoholLevel = 0;
|
||||
|
||||
_boughtOnion = false;
|
||||
|
||||
for (int i = 0; i < kParserWordsNum; ++i)
|
||||
_vocabulary[i].init(1, "");
|
||||
}
|
||||
|
||||
void Parser::init() {
|
||||
@ -829,11 +832,7 @@ void Parser::parse() {
|
||||
// Check Accis's own table (words[]) for "global" commands.
|
||||
if (notfound) {
|
||||
byte answer = wordNum(thisword);
|
||||
if (answer == kPardon) {
|
||||
notfound = true;
|
||||
_thats = _thats + kPardon;
|
||||
} else
|
||||
_thats = _thats + answer;
|
||||
_thats = _thats + answer;
|
||||
n++;
|
||||
}
|
||||
|
||||
@ -1098,7 +1097,8 @@ void Parser::examine() {
|
||||
else if ((50 <= _thing) && (_thing <= 100)) {
|
||||
// Also _thing
|
||||
int id = _thing - 50;
|
||||
assert(id < 31);
|
||||
if (id >= 31)
|
||||
error("Parser::Examine - Unexpected _thing value %d (>80)", _thing);
|
||||
openBox(true);
|
||||
_vm->_dialogs->displayText(*_vm->_also[id][1]);
|
||||
openBox(false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user