From 5945ee1d741a9a51b1cb5c48080f88c8ea3b3453 Mon Sep 17 00:00:00 2001
From: Paolo Capriotti
Date: Wed, 8 Aug 2007 18:06:10 +0200
Subject: [PATCH] Fixed pool update bug.
---
src/hlvariant/dropanimator.h | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/hlvariant/dropanimator.h b/src/hlvariant/dropanimator.h
index cc111e7..97e2847 100644
--- a/src/hlvariant/dropanimator.h
+++ b/src/hlvariant/dropanimator.h
@@ -65,22 +65,19 @@ void DropAnimatorMixin::updatePool(const GameState& final) {
}
NamedSprite sprite = m_cinterface->getPoolSprite(color, index);
- Piece piece;
int i;
// find a matching piece on the pool
for (i = index; i < n; i++) {
- piece = pool.get(i);
- if (piece.name() == sprite.name())
+ if (pool.get(i).name() == sprite.name())
break;
}
if (i < n) {
// matching piece found on the pool
// insert all pieces before this one on the graphical pool
- for (int j = index; j < i; j++) {
- m_cinterface->insertPoolPiece(color, j, piece);
- }
+ for (int j = index; j < i; j++)
+ m_cinterface->insertPoolPiece(color, j, pool.get(j));
index = i + 1;
}
else {
@@ -90,9 +87,8 @@ void DropAnimatorMixin::updatePool(const GameState& final) {
}
// remove extra pieces from the graphical pool
- while (m_cinterface->poolSize(color) > n) {
+ while (m_cinterface->poolSize(color) > n)
m_cinterface->removePoolSprite(color, n);
- }
}
}
--
2.11.4.GIT