diff --git a/src/enemy.c b/src/enemy.c index 27be8826..b3a1390e 100644 --- a/src/enemy.c +++ b/src/enemy.c @@ -312,7 +312,7 @@ CheckIfWayIsFreeOfDroids ( float x1 , float y1 , float x2 , float y2 , int OurLe DebugPrintf( 2, "\nint CheckIfWayIsFreeOfDroids (...) : Checking from %d-%d to %d-%d.", (int) x1, (int) y1 , (int) x2, (int) y2 ); fflush(stdout); - if ( abs(x1-x2) > abs (y1-y2) ) LargerDistance=fabsf(x1-x2); + if ( abs((int)(x1-x2)) > abs ((int)(y1-y2)) ) LargerDistance=fabsf(x1-x2); else LargerDistance=fabsf(y1-y2); Steps=LargerDistance * 4 ; // We check four times on each map tile... diff --git a/src/influ.c b/src/influ.c index e5c045a7..47c83648 100644 --- a/src/influ.c +++ b/src/influ.c @@ -502,7 +502,7 @@ CheckInfluenceWallCollisions (void) { crashx = TRUE; /* In X wurde gecrasht */ sign = (SX < 0) ? -1 : 1; - SX = abs (SX); + SX = abs ((int)SX); NumberOfShifts=0; while (--SX && (DruidPassable (lastpos.x + sign * SX, lastpos.y) != @@ -518,7 +518,7 @@ CheckInfluenceWallCollisions (void) { crashy = TRUE; /* in Y wurde gecrasht */ sign = (SY < 0) ? -1 : 1; - SY = abs (SY); + SY = abs ((int)SY); NumberOfShifts=0; while (--SY && (DruidPassable (lastpos.x, lastpos.y + sign * SY) != @@ -727,9 +727,9 @@ CheckInfluenceEnemyCollision (void) xdist = Me.pos.x - AllEnemys[i].pos.x; ydist = Me.pos.y - AllEnemys[i].pos.y; - if (abs (xdist) > 1) + if (abs ((int)xdist) > 1) continue; - if (abs (ydist) > 1) + if (abs ((int)ydist) > 1) continue; dist2 = sqrt( (xdist * xdist) + (ydist * ydist) ); diff --git a/src/map.c b/src/map.c index 35d01af9..1a23fc30 100644 --- a/src/map.c +++ b/src/map.c @@ -1315,10 +1315,10 @@ MoveLevelDoors (void) AllEnemys[j].levelnum != CurLevel->levelnum) continue; - xdist = abs (AllEnemys[j].pos.x - doorx); + xdist = abs ((int)(AllEnemys[j].pos.x - doorx)); if (xdist < Block_Rect.w) { - ydist = abs (AllEnemys[j].pos.y - doory); + ydist = abs ((int)(AllEnemys[j].pos.y - doory)); if (ydist < Block_Rect.h) { dist2 = xdist * xdist + ydist * ydist;