aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2013-12-17 07:52:06 +0100
committerStrangerke2013-12-17 07:52:06 +0100
commitee34fcef43a527f2de12b48f89934ebab4478c08 (patch)
treec1b8ff6f7921855af34e141c113d92fd9abb4f76
parent408f1b3aa3dde0c5d72bc8be180d3ef1675f9705 (diff)
downloadscummvm-rg350-ee34fcef43a527f2de12b48f89934ebab4478c08.tar.gz
scummvm-rg350-ee34fcef43a527f2de12b48f89934ebab4478c08.tar.bz2
scummvm-rg350-ee34fcef43a527f2de12b48f89934ebab4478c08.zip
AVALANCHE: Fix variable initialization in Nim
-rw-r--r--engines/avalanche/nim.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp
index a2572f1fa5..15146eaf63 100644
--- a/engines/avalanche/nim.cpp
+++ b/engines/avalanche/nim.cpp
@@ -35,11 +35,27 @@ const char * const Nim::kNames[2] = {"Avalot", "Dogfood"};
Nim::Nim(AvalancheEngine *vm) {
_vm = vm;
- _playedNim = 0;
+ resetVariables();
}
void Nim::resetVariables() {
_playedNim = 0;
+ _turns = 0;
+ _dogfoodsTurn = false;
+ _stonesLeft = 0;
+ _clicked = false;
+ _row = 0;
+ _number = 0;
+ _squeak = false;
+ _mNum = 0;
+ _mRow = 0;
+
+ for (int i = 0; i < 3; i++) {
+ _old[i] = 0;
+ _stones[i] = 0;
+ }
+
+ memset(_stonePic, 0, 4 * 23 * 7);
}
void Nim::synchronize(Common::Serializer &sz) {