- added custom math routines for reliability.

This commit is contained in:
Christoph Oelckers 2016-03-11 15:45:47 +01:00
commit 161d03231a
50 changed files with 4027 additions and 122 deletions

View file

@ -21,6 +21,7 @@
#include "d_player.h"
#include "p_spec.h"
#include "p_checkposition.h"
#include "math/cmath.h"
static FRandom pr_botopendoor ("BotOpenDoor");
static FRandom pr_bottrywalk ("BotTryWalk");
@ -348,7 +349,7 @@ void DBot::Pitch (AActor *target)
double diff;
diff = target->Z() - player->mo->Z();
aim = atan(diff / (double)player->mo->AproxDistance(target));
aim = g_atan(diff / (double)player->mo->AproxDistance(target));
player->mo->pitch = -(int)(aim * ANGLE_180/M_PI);
}