fixed mines having seizures when moving
This commit is contained in:
parent
e265292843
commit
6c8b04de69
BIN
obj/entities.o
BIN
obj/entities.o
Binary file not shown.
|
@ -80,12 +80,13 @@ void detectHit(float dtime, int* hp, int* dmg, cube_0* ret) {
|
|||
}
|
||||
|
||||
void go_to_player(double x, double y, double z, double w, double h, double d, double hz_angle, double vt_angle, float dtime, cube_0* ret) {
|
||||
double dx = (x+w/2 - camx) ;
|
||||
double dy = (y+h/2 - camy) ;
|
||||
double dx = (x+w/2 - camx);
|
||||
double dy = (y+h/2 - camy);
|
||||
double dz = (z+d/2 - camz);
|
||||
dx = 10.0*dx/absf(dx);
|
||||
dy = 10.0*dy/absf(dy);
|
||||
dz = 10.0*dz/absf(dz);
|
||||
double total = sqrt(dx*dx + dy*dy + dz*dz) ;
|
||||
dx = 7.0*dx/total;
|
||||
dy = 7.0*dy/total;
|
||||
dz = 7.0*dz/total;
|
||||
ret->x -=12.0*dtime*dx ;
|
||||
if(is_colliding_with_map(*ret) || is_colliding_with_tp(*ret)) {
|
||||
ret->x +=12.0*dtime*dx ;
|
||||
|
|
Loading…
Reference in New Issue