From 9c819e70422c5f319e6ba74f85e240621c0ed80b Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 8 Mar 2007 00:09:20 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@516 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gameexec.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index a73fb2d5c..02f165273 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -3256,7 +3256,7 @@ static void move(void) goalang = getangle(ps[g_p].oposx-g_sp->x,ps[g_p].oposy-g_sp->y); else goalang = getangle(ps[g_p].posx-g_sp->x,ps[g_p].posy-g_sp->y); angdif = getincangle(g_sp->ang,goalang)>>2; - if (angdif > -8 && angdif < 0) angdif = 0; + if ((angdif > -8 && angdif < 0) || (angdif > 0 && angdif < 8)) angdif = 0; g_sp->ang += angdif; } @@ -3269,7 +3269,7 @@ static void move(void) goalang = getangle(ps[g_p].oposx-g_sp->x,ps[g_p].oposy-g_sp->y); else goalang = getangle(ps[g_p].posx-g_sp->x,ps[g_p].posy-g_sp->y); angdif = ksgn(getincangle(g_sp->ang,goalang))<<5; - if (angdif > -32 && angdif < 0) + if ((angdif > -32 && angdif < 0) || (angdif > 0 && angdif < 32)) { angdif = 0; g_sp->ang = goalang; @@ -3285,13 +3285,12 @@ static void move(void) if (a&face_player_smart) { - long newx,newy; - - newx = ps[g_p].posx+(ps[g_p].posxv/768); - newy = ps[g_p].posy+(ps[g_p].posyv/768); + long newx = ps[g_p].posx+(ps[g_p].posxv/768); + long newy = ps[g_p].posy+(ps[g_p].posyv/768); + goalang = getangle(newx-g_sp->x,newy-g_sp->y); angdif = getincangle(g_sp->ang,goalang)>>2; - if (angdif > -8 && angdif < 0) angdif = 0; + if ((angdif > -8 && angdif < 0) || (angdif > 0 && angdif < 8)) angdif = 0; g_sp->ang += angdif; }