diff options
| -rw-r--r-- | engines/gob/game.cpp | 6 | ||||
| -rw-r--r-- | engines/gob/game.h | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp index 09f925bcc7..29319996b5 100644 --- a/engines/gob/game.cpp +++ b/engines/gob/game.cpp @@ -44,8 +44,6 @@ namespace Gob { Environments::Environments(GobEngine *vm) : _vm(vm) { - _environments = new Environment[kEnvironmentCount]; - for (uint i = 0; i < kEnvironmentCount; i++) { Environment &e = _environments[i]; @@ -60,8 +58,6 @@ Environments::Environments(GobEngine *vm) : _vm(vm) { Environments::~Environments() { clear(); - - delete[] _environments; } void Environments::clear() { @@ -565,7 +561,7 @@ void Game::totSub(int8 flags, const char *newTotFile) { warning("Urban Stub: Game::totSub(), flags == %d", flags); if (_numEnvironments >= Environments::kEnvironmentCount) - return; + error("Game::totSub(): Environments overflow"); _environments->set(_numEnvironments); diff --git a/engines/gob/game.h b/engines/gob/game.h index a9985028cb..186afdee1a 100644 --- a/engines/gob/game.h +++ b/engines/gob/game.h @@ -37,7 +37,7 @@ class Hotspots; class Environments { public: - static const uint8 kEnvironmentCount = 5; + static const uint8 kEnvironmentCount = 20; Environments(GobEngine *vm); ~Environments(); @@ -48,7 +48,7 @@ public: const char *getTotFile(uint8 env) const; bool has(Variables *variables, uint8 startEnv = 0, int16 except = -1) const; - bool has(Script *script , uint8 startEnv = 0, int16 except = -1) const; + bool has(Script *script , uint8 startEnv = 0, int16 except = -1) const; bool has(Resources *resources, uint8 startEnv = 0, int16 except = -1) const; void clear(); @@ -65,7 +65,7 @@ private: GobEngine *_vm; - Environment *_environments; + Environment _environments[kEnvironmentCount]; }; class Game { |
