From a95820956e046c13249bc75f6e1fa26bcddc9d52 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 2 Nov 2011 23:58:29 +0000 Subject: CGE: Fix array bounds check --- engines/cge/snail.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/cge') diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp index cbc463ced2..5ab8f6314b 100644 --- a/engines/cge/snail.cpp +++ b/engines/cge/snail.cpp @@ -406,7 +406,7 @@ void CGEEngine::snGame(Sprite *spr, int num) { Stage++; if (hand && Stage > kDressed) ++hand; - if (i >= 0 || (dup[i] == spr && newRandom(3) == 0)) { + if (i >= 0 && (dup[i] == spr && newRandom(3) == 0)) { _commandHandler->addCommand(kCmdSeq, -1, 3, dup[0]); // Yes _commandHandler->addCommand(kCmdSeq, -1, 3, dup[1]); // Yes _commandHandler->addCommand(kCmdSeq, -1, 3, dup[2]); // Yes -- cgit v1.2.3