[planetblupi] 54/61: Cosmetic: invert logic
Didier Raboud
odyx at moszumanska.debian.org
Thu Nov 2 19:25:01 UTC 2017
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository planetblupi.
commit fdcfd891cc69c3f3d205d5a65014ae88c335bbfc
Author: Mathieu Schroeter <mathieu at schroetersa.ch>
Date: Wed Nov 1 07:29:23 2017 +0100
Cosmetic: invert logic
---
src/path.cxx | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/path.cxx b/src/path.cxx
index 8b35317..9a762b7 100644
--- a/src/path.cxx
+++ b/src/path.cxx
@@ -170,27 +170,27 @@ CDecor::CheminFillTerrain (Sint32 rank)
if (step < but)
for (dir = 0; dir < 8; dir++)
{
- if (CheminTestDirection (rank, pos, dir, next, ampli, cout, action))
- {
- last = pos + ampli * next;
- if (last < 0 || last >= MAXCELX * MAXCELY)
- continue;
+ if (!CheminTestDirection (rank, pos, dir, next, ampli, cout, action))
+ continue;
- if (m_cheminWork[last] == 0 || m_cheminWork[last] > step + cout)
- {
- // marque les cases sautées
- for (Sint32 i = 1; i < ampli; i++)
- m_cheminWork[pos + i * next] = step + cout - ampli + i;
+ last = pos + ampli * next;
+ if (last < 0 || last >= MAXCELX * MAXCELY)
+ continue;
- m_cheminWork[last] = step + cout;
+ if (m_cheminWork[last] != 0 && m_cheminWork[last] <= step + cout)
+ continue;
- dx = m_blupi[rank].goalCel.x - last % MAXCELX;
- dy = m_blupi[rank].goalCel.y - last / MAXCELX;
+ // marque les cases sautées
+ for (Sint32 i = 1; i < ampli; i++)
+ m_cheminWork[pos + i * next] = step + cout - ampli + i;
- dist = (Sint32) (dy * dy) + (Sint32) (dx * dx);
- fifo.put (last, dist);
- }
- }
+ m_cheminWork[last] = step + cout;
+
+ dx = m_blupi[rank].goalCel.x - last % MAXCELX;
+ dy = m_blupi[rank].goalCel.y - last / MAXCELX;
+
+ dist = (Sint32) (dy * dy) + (Sint32) (dx * dx);
+ fifo.put (last, dist);
}
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/planetblupi.git
More information about the Pkg-games-commits
mailing list