Skip to content

Commit

Permalink
Fixed old mobj angle adjustment logic
Browse files Browse the repository at this point in the history
In Heretic, door key orb statues are turned away from the doors.
  • Loading branch information
skyjake committed Dec 17, 2011
1 parent fcf163d commit 3be2f18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion doomsday/plugins/common/include/p_start.h
Expand Up @@ -142,7 +142,7 @@ mobjtype_t P_DoomEdNumToMobjType(int doomEdNum);
void P_SpawnPlayers(void);
void P_MoveThingsOutOfWalls();
#if __JHERETIC__
void P_TurnGizmosAwayFromDoors();
void P_TurnGizmosAwayFromDoors(void);
#endif

#if __JHERETIC__
Expand Down
9 changes: 4 additions & 5 deletions doomsday/plugins/common/src/p_start.c
Expand Up @@ -1218,9 +1218,8 @@ float P_PointLineDistance(linedef_t *line, float x, float y, float *offset)
len = sqrt(d[VX] * d[VX] + d[VY] * d[VY]); // Accurate.

if(offset)
*offset =
((a[VY] - c[VY]) * (a[VY] - b[VY]) -
(a[VX] - c[VX]) * (b[VX] - a[VX])) / len;
*offset = ((a[VY] - c[VY]) * (a[VY] - b[VY]) -
(a[VX] - c[VX]) * (b[VX] - a[VX])) / len;
return ((a[VY] - c[VY]) * (b[VX] - a[VX]) -
(a[VX] - c[VX]) * (b[VY] - a[VY])) / len;
}
Expand All @@ -1236,7 +1235,7 @@ void P_TurnGizmosAwayFromDoors(void)
mobj_t *iter;
uint i, l;
int k, t;
linedef_t *closestline = NULL, *li;
linedef_t *closestline = NULL, *li;
xline_t *xli;
float closestdist = 0, dist, off, linelen; //, minrad;
mobj_t *tlist[MAXLIST];
Expand Down Expand Up @@ -1266,7 +1265,7 @@ void P_TurnGizmosAwayFromDoors(void)

li = P_ToPtr(DMU_LINEDEF, l);

if(P_GetPtrp(li, DMU_BACK_SECTOR))
if(!P_GetPtrp(li, DMU_BACK_SECTOR))
continue;

xli = P_ToXLine(li);
Expand Down

0 comments on commit 3be2f18

Please sign in to comment.