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.
|
@ -83,9 +83,10 @@ void go_to_player(double x, double y, double z, double w, double h, double d, do
|
|||
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