mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Cosmetic: invert logic
This commit is contained in:
parent
61bd9261bf
commit
fdcfd891cc
34
src/path.cxx
34
src/path.cxx
@ -170,27 +170,27 @@ CDecor::CheminFillTerrain (Sint32 rank)
|
|||||||
if (step < but)
|
if (step < but)
|
||||||
for (dir = 0; dir < 8; dir++)
|
for (dir = 0; dir < 8; dir++)
|
||||||
{
|
{
|
||||||
if (CheminTestDirection (rank, pos, dir, next, ampli, cout, action))
|
if (!CheminTestDirection (rank, pos, dir, next, ampli, cout, action))
|
||||||
{
|
continue;
|
||||||
last = pos + ampli * next;
|
|
||||||
if (last < 0 || last >= MAXCELX * MAXCELY)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (m_cheminWork[last] == 0 || m_cheminWork[last] > step + cout)
|
last = pos + ampli * next;
|
||||||
{
|
if (last < 0 || last >= MAXCELX * MAXCELY)
|
||||||
// marque les cases sautées
|
continue;
|
||||||
for (Sint32 i = 1; i < ampli; i++)
|
|
||||||
m_cheminWork[pos + i * next] = step + cout - ampli + i;
|
|
||||||
|
|
||||||
m_cheminWork[last] = step + cout;
|
if (m_cheminWork[last] != 0 && m_cheminWork[last] <= step + cout)
|
||||||
|
continue;
|
||||||
|
|
||||||
dx = m_blupi[rank].goalCel.x - last % MAXCELX;
|
// marque les cases sautées
|
||||||
dy = m_blupi[rank].goalCel.y - last / MAXCELX;
|
for (Sint32 i = 1; i < ampli; i++)
|
||||||
|
m_cheminWork[pos + i * next] = step + cout - ampli + i;
|
||||||
|
|
||||||
dist = (Sint32) (dy * dy) + (Sint32) (dx * dx);
|
m_cheminWork[last] = step + cout;
|
||||||
fifo.put (last, dist);
|
|
||||||
}
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user