diff --git a/src/scriptfuncs.c b/src/scriptfuncs.c index 693d851af..419f28916 100644 --- a/src/scriptfuncs.c +++ b/src/scriptfuncs.c @@ -7464,7 +7464,7 @@ BOOL scrMapRevealedInRange(void) /* Returns true if a certain map tile was revealed, ie fog of war was removed */ BOOL scrMapTileVisible(void) { - SDWORD tileX,tileY,wRange,player; + SDWORD tileX,tileY,player; if (!stackPopParams(3, VAL_INT, &tileX, VAL_INT, &tileY, VAL_INT, &player)) { diff --git a/src/stats.c b/src/stats.c index b5dc112d8..4780866ea 100644 --- a/src/stats.c +++ b/src/stats.c @@ -3513,4 +3513,4 @@ BOOL objHasWeapon(BASE_OBJECT *psObj) } return FALSE; -} \ No newline at end of file +} diff --git a/src/warcam.c b/src/warcam.c index fb72046af..4abf421e1 100644 --- a/src/warcam.c +++ b/src/warcam.c @@ -1026,14 +1026,18 @@ static void updateCameraRotationAcceleration( UBYTE update ) trackingCamera.rotation.x+=DEG(360); } worldAngle = trackingCamera.rotation.x; - separation = fmodf(xConcern - worldAngle, DEG(360)); + separation = xConcern - worldAngle; - // Make sure that rotations larger than 180 degrees are noted - // in the range of -180 - 0 degrees. - if (separation > DEG(180)) + // Make sure that rotations are noted + // in the range of -180 - 180 degrees. + while (separation > DEG(180)) { separation -= DEG(360); } + while (separation < -DEG(180)) + { + separation += DEG(360); + } /* Make new acceleration */ trackingCamera.rotAccel.x =