aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-07-15 19:32:07 +0200
committerStrangerke2014-07-15 19:32:07 +0200
commitfbd8f2c390af8f73a138110450e4f2b98adffd49 (patch)
tree4f4e8f6b4ae8baeac4efe418d7c819ac06d06eb1
parent8fae34df055ecc90cce6324a8c9eb09112e21e31 (diff)
downloadscummvm-rg350-fbd8f2c390af8f73a138110450e4f2b98adffd49.tar.gz
scummvm-rg350-fbd8f2c390af8f73a138110450e4f2b98adffd49.tar.bz2
scummvm-rg350-fbd8f2c390af8f73a138110450e4f2b98adffd49.zip
CGE2: Some rework in snail
-rw-r--r--engines/cge2/snail.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp
index 284cecff3f..84a0373ff5 100644
--- a/engines/cge2/snail.cpp
+++ b/engines/cge2/snail.cpp
@@ -691,21 +691,20 @@ void CGE2Engine::snSound(Sprite *spr, int wav) {
void CGE2Engine::snRoom(Sprite *spr, bool on) {
if (!isHero(spr))
return;
- int sx = spr->_ref & 1;
- Sprite **p = _heroTab[sx]->_pocket;
+
+ int sex = spr->_ref & 1;
+ Sprite **p = _heroTab[sex]->_pocket;
if (on) {
- if (freePockets(sx) == 0 && p[kPocketMax] == nullptr) {
+ if (freePockets(sex) == 0 && p[kPocketMax] == nullptr) {
SWAP(p[kPocketMax], p[kPocketMax - 1]);
snHide(p[kPocketMax], 1);
}
- } else {
- if (p[kPocketMax]) {
- for (int i = 0; i < kPocketMax; i++) {
- if (p[i] == nullptr) {
- snHide(p[kPocketMax], 0);
- SWAP(p[kPocketMax], p[i]);
- break;
- }
+ } else if (p[kPocketMax]) {
+ for (int i = 0; i < kPocketMax; i++) {
+ if (p[i] == nullptr) {
+ snHide(p[kPocketMax], 0);
+ SWAP(p[kPocketMax], p[i]);
+ break;
}
}
}
@@ -715,7 +714,7 @@ void CGE2Engine::snDim(Sprite *spr, int val) {
if (isHero(spr)) {
if (val > 0)
++*(Hero*)spr;
- if (val < 0)
+ else if (val < 0)
--*(Hero*)spr;
}
}
@@ -951,7 +950,7 @@ void CGE2Engine::feedSnail(Sprite *spr, Action snq, Hero *hero) {
}
if (c->_commandType == kCmdIf) {
Sprite *s = (c->_ref < 0) ? spr : _vga->_showQ->locate(c->_ref);
- if (s) { // sprite extsts
+ if (s) { // sprite exists
if (!s->seqTest(-1)) { // not parked
int v = c->_val;
if (v > 255) if (s) v = s->labVal(snq, v >> 8);