diff options
author | Strangerke | 2013-09-25 07:46:09 +0200 |
---|---|---|
committer | Strangerke | 2013-09-25 07:46:09 +0200 |
commit | 1b1655d0c859bae76ad2f418eb2f7ef62414f2da (patch) | |
tree | 9e82dde16d79d548a8d0e6e4bc822961eb5e64cf /engines/avalanche | |
parent | 5637987bd74c9d5670b6b9b1a2578717abf52dfb (diff) | |
download | scummvm-rg350-1b1655d0c859bae76ad2f418eb2f7ef62414f2da.tar.gz scummvm-rg350-1b1655d0c859bae76ad2f418eb2f7ef62414f2da.tar.bz2 scummvm-rg350-1b1655d0c859bae76ad2f418eb2f7ef62414f2da.zip |
AVALANCHE: use nullptr for empty pointers
Diffstat (limited to 'engines/avalanche')
-rw-r--r-- | engines/avalanche/avalot.cpp | 14 | ||||
-rw-r--r-- | engines/avalanche/parser.cpp | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index c9ffdff987..b6c3f0b1b9 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -264,7 +264,7 @@ Avalot::Avalot(AvalancheEngine *vm) : _fxHidden(false), _clock(vm), _interrogati // Needed because of Lucerna::load_also() for (int i = 0; i < 31; i++) { for (int j = 0; j < 2; j++) - _also[i][j] = 0; + _also[i][j] = nullptr; } _totalTime = 0; @@ -273,9 +273,9 @@ Avalot::Avalot(AvalancheEngine *vm) : _fxHidden(false), _clock(vm), _interrogati Avalot::~Avalot() { for (int i = 0; i < 31; i++) { for (int j = 0; j < 2; j++) { - if (_also[i][j] != 0) { + if (_also[i][j] != nullptr) { delete _also[i][j]; - _also[i][j] = 0; + _also[i][j] = nullptr; } } } @@ -437,7 +437,7 @@ void Avalot::runAvalot() { void Avalot::init() { for (int i = 0; i < 31; i++) { for (int j = 0; j < 2; j++) - _also[i][j] = 0; + _also[i][j] = nullptr; } #if 0 @@ -520,7 +520,7 @@ void Avalot::scram(Common::String &str) { void Avalot::unScramble() { for (int i = 0; i < 31; i++) { for (int j = 0; j < 2; j++) { - if (_also[i][j] != 0) + if (_also[i][j] != nullptr) scram(*_also[i][j]); } } @@ -531,9 +531,9 @@ void Avalot::unScramble() { void Avalot::loadAlso(byte num) { for (int i = 0; i < 31; i++) { for (int j = 0; j < 2; j++) { - if (_also[i][j] != 0) { + if (_also[i][j] != nullptr) { delete _also[i][j]; - _also[i][j] = 0; + _also[i][j] = nullptr; } } } diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index 4abdb31431..30e08c71c0 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -761,7 +761,7 @@ void Parser::parse() { // Check also[] first, which contains words about the actual room. if (!thisword.empty()) { for (int i = 0; i < 31; i++) { - if ((_vm->_avalot->_also[i][0] != 0) && (getPos(',' + thisword, *_vm->_avalot->_also[i][0]) > -1)) { + if ((_vm->_avalot->_also[i][0]) && (getPos(',' + thisword, *_vm->_avalot->_also[i][0]) > -1)) { _thats += Common::String(99 + i); notfound = false; } |