- some refactoring of P_AproxDistance calls into newly defined AActor method AproxDistance.

The main reason here is to reduce the number of instances where AActor::x and AActor::y are being referenced.
This commit is contained in:
Christoph Oelckers 2016-01-10 17:52:41 +01:00
commit 1e2ce9a622
25 changed files with 1293 additions and 1286 deletions

View file

@ -347,7 +347,7 @@ void DBot::Pitch (AActor *target)
double diff;
diff = target->z - player->mo->z;
aim = atan (diff / (double)P_AproxDistance (player->mo->x - target->x, player->mo->y - target->y));
aim = atan(diff / (double)player->mo->AproxDistance(target));
player->mo->pitch = -(int)(aim * ANGLE_180/M_PI);
}