diff options
author | Strangerke | 2014-08-03 01:49:59 +0200 |
---|---|---|
committer | Strangerke | 2014-08-03 01:51:33 +0200 |
commit | 9dc06870e79edd637280ef9a81391adca1eafabc (patch) | |
tree | b4d5286a18214b5dc67a27721f235812a7c63819 /engines/cge2/hero.cpp | |
parent | d44ff5491281fb9bcd4cc8f4534988b0b2bcb052 (diff) | |
download | scummvm-rg350-9dc06870e79edd637280ef9a81391adca1eafabc.tar.gz scummvm-rg350-9dc06870e79edd637280ef9a81391adca1eafabc.tar.bz2 scummvm-rg350-9dc06870e79edd637280ef9a81391adca1eafabc.zip |
CGE2: Start removing the checks on the return value of new
Diffstat (limited to 'engines/cge2/hero.cpp')
-rw-r--r-- | engines/cge2/hero.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/engines/cge2/hero.cpp b/engines/cge2/hero.cpp index 3bb7c82713..91f6354ce3 100644 --- a/engines/cge2/hero.cpp +++ b/engines/cge2/hero.cpp @@ -53,9 +53,8 @@ Sprite *Hero::expand() { if (_ext != nullptr) delete _ext; + _ext = new SprExt(_vm); - if (_ext == nullptr) - error("No core %s", fname); if (!*_file) return this; @@ -79,21 +78,15 @@ Sprite *Hero::expand() { for (int i = 0; i < kActions; i++) { byte n = _actionCtrl[i]._cnt; - if (n) { + if (n) _ext->_actions[i] = new CommandHandler::Command[n]; - if (_ext->_actions[i] == nullptr) - error("No core %s", fname); - } else + else _ext->_actions[i] = nullptr; } - Seq *curSeq; - if (_seqCnt) { + Seq *curSeq = nullptr; + if (_seqCnt) curSeq = new Seq[_seqCnt]; - if (curSeq == nullptr) - error("No core %s", fname); - } else - curSeq = nullptr; if (_vm->_resman->exist(fname)) { // sprite description file exist EncryptedStream sprf(_vm, fname); |