AVALANCHE: Fix even more GCC warnings

This commit is contained in:
Strangerke 2013-09-04 18:34:58 +02:00
parent 97843d9e94
commit 08e8e92e3a
4 changed files with 20 additions and 17 deletions

View File

@ -1372,8 +1372,8 @@ void Acci::doThat() {
case kVerbCodeTalk:
if (_person == kPardon) {
if (_vm->_gyro->subjnumber == 99) // They typed "say password".
_vm->_scrolls->display(Common::String("Yes, but kWhat ") + _vm->_scrolls->kControlItalic + "is" + _vm->_scrolls->kControlRoman + " the password?");
else if (((1 <= _vm->_gyro->subjnumber) && (_vm->_gyro->subjnumber <= 49)) || (_vm->_gyro->subjnumber == 253) || (_vm->_gyro->subjnumber == 449)) {
_vm->_scrolls->display(Common::String("Yes, but what ") + _vm->_scrolls->kControlItalic + "is" + _vm->_scrolls->kControlRoman + " the password?");
else if (((1 <= _vm->_gyro->subjnumber) && (_vm->_gyro->subjnumber <= 49)) || (_vm->_gyro->subjnumber == 253) || (_vm->_gyro->subjnumber == 249)) {
_thats.deleteChar(0);
for (byte i = 0; i < 10; i++)
@ -1890,9 +1890,10 @@ void Acci::doThat() {
for (byte i = 0; i < _thats.size(); i++) {
Common::String temp = _realWords[i];
temp.toUppercase();
for (byte i = 0; i < kVocabulary[_vm->_gyro->dna.pass_num + kFirstPassword]._word.size(); i++)
if (kVocabulary[_vm->_gyro->dna.pass_num + kFirstPassword]._word[i] != temp[i])
for (byte j = 0; j < kVocabulary[_vm->_gyro->dna.pass_num + kFirstPassword]._word.size(); j++) {
if (kVocabulary[_vm->_gyro->dna.pass_num + kFirstPassword]._word[j] != temp[j])
ok = false;
}
}
if (ok) {

View File

@ -152,14 +152,15 @@ void Celer::updateBackgroundSprites() {
case r__lustiesroom:
if (!(_vm->_gyro->dna.lustie_is_asleep)) {
byte direction = 0;
uint16 angle = _vm->_lucerna->bearing(2);
if ((_vm->_gyro->roomtime % 45) > 42)
direction = 4; // du Lustie blinks.
// Bearing of Avvy from du Lustie.
else if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
else if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
direction = 1; // Middle.
else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
else if ((angle >= 45) && (angle <= 180))
direction = 2; // Left.
else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
else if ((angle >= 181) && (angle <= 314))
direction = 3; // Right.
if (direction != _vm->_gyro->dna.dogfoodpos) { // Only if it's changed.
@ -195,11 +196,12 @@ void Celer::updateBackgroundSprites() {
case r__nottspub: {
// Bearing of Avvy from Port.
byte direction = 0;
if (((_vm->_lucerna->bearing(5) >= 0) && (_vm->_lucerna->bearing(5) <= 45)) || ((_vm->_lucerna->bearing(5) >= 315) && (_vm->_lucerna->bearing(5) <= 360)))
uint16 angle = _vm->_lucerna->bearing(5);
if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
direction = 2; // Middle.
else if ((_vm->_lucerna->bearing(5) >= 45) && (_vm->_lucerna->bearing(5) <= 180))
else if ((angle >= 45) && (angle <= 180))
direction = 6; // Left.
else if ((_vm->_lucerna->bearing(5) >= 181) && (_vm->_lucerna->bearing(5) <= 314))
else if ((angle >= 181) && (angle <= 314))
direction = 8; // Right.
if ((_vm->_gyro->roomtime % 60) > 57)
@ -226,11 +228,12 @@ void Celer::updateBackgroundSprites() {
// Bearing of Avvy from Duck.
byte direction = 0;
if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
uint16 angle = _vm->_lucerna->bearing(2);
if ((angle <= 45) || ((angle >= 315) && (angle <= 360)))
direction = 4; // Middle.
else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
else if ((angle >= 45) && (angle <= 180))
direction = 6; // Left.
else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
else if ((angle >= 181) && (angle <= 314))
direction = 8; // Right.
if ((_vm->_gyro->roomtime % 45) > 42)

View File

@ -96,7 +96,8 @@ Common::String Enid::expanddate(byte d, byte m, uint16 y) {
day = _vm->_gyro->strf(d);
if (((d >= 0) && (d <= 9)) || ((d >= 21) && (d <= 31))) {
// d is always positive
if ((d <= 9) || ((d >= 21) && (d <= 31))) {
switch (d % 10) {
case 1:
day = day + "st";

View File

@ -1454,10 +1454,8 @@ void Trip::getsetclear() {
}
void Trip::hide_in_the_cupboard() {
const char nowt = '\xFA'; /* As in Acci. */
if (_vm->_gyro->dna.avvys_in_the_cupboard) {
if (_vm->_gyro->dna.wearing == nowt)
if (_vm->_gyro->dna.wearing == Acci::kNothing)
_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "AVVY!" + _vm->_scrolls->kControlRoman + "Get dressed first!");
else {
tr[0].visible = true;