- 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

@ -76,6 +76,7 @@
#include "d_player.h"
#include "p_maputl.h"
#include "p_spec.h"
#include "math/cmath.h"
AActor *SingleActorFromTID(int tid, AActor *defactor);
@ -1935,7 +1936,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun)
DVector2 xydiff(pos.x, pos.y);
double zdiff = (self->target->Z() + (self->target->height>>1)) -
(self->Z() + (self->height>>1) - self->floorclip);
self->pitch = int(atan2(zdiff, xydiff.Length()) * ANGLE_180 / -M_PI);
self->pitch = int(g_atan2(zdiff, xydiff.Length()) * ANGLE_180 / -M_PI);
}
// Let the aim trail behind the player
if (aim)