fixed mines having seizures when moving

This commit is contained in:
Alexandre 2025-01-23 18:04:34 +01:00
parent e265292843
commit 6c8b04de69
3 changed files with 6 additions and 5 deletions

BIN
bin/back

Binary file not shown.

Binary file not shown.

View File

@ -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 ;