Fix startzone tile generation

This commit is contained in:
Denis-Cosmin Nutiu 2019-06-02 18:01:59 +03:00
parent 37ed3df4e6
commit 295f16e499

View file

@ -56,19 +56,19 @@ namespace src.Managers
{ {
/* We want the following positions to be a safe zone. */ /* We want the following positions to be a safe zone. */
/* Don't place anything on starting position */ /* Don't place anything on starting position */
if (Math.Abs(x) < 0.001 && Math.Abs(y) < 0.001) if (Mathf.FloorToInt(x) == 0 && Mathf.FloorToInt(y) == 0)
{ {
continue; continue;
} }
/* Don't place anything on X=1 and Y=0 */ /* Don't place anything on X=1 and Y=0 */
if (Math.Abs(x - 1) < 0.001 && Math.Abs(y) < 0.001) if (Mathf.FloorToInt(x) == 1 && Mathf.FloorToInt(y) == 0)
{ {
continue; continue;
} }
/* Don't place anything on X=0 and Y=1 */ /* Don't place anything on X=0 and Y=1 */
if (Math.Abs(x) < 0.001 && Math.Abs(y - 1) < 0.001) if (Mathf.FloorToInt(x) == 0 && Mathf.FloorToInt(y) == 1)
{ {
continue; continue;
} }