From 7757997e56f98c3c47442a0ff0c7dc779c4d8373 Mon Sep 17 00:00:00 2001
From: Rtch90 <ritchie.cunningham@protonmail.com>
Date: Fri, 17 Nov 2017 20:59:13 +0000
Subject: [PATCH] [Fix] Fixed assertion when facing away from target.

---
 src/player.cpp       | 2 +-
 src/sbre/Makefile.am | 2 +-
 src/sector_view.cpp  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/player.cpp b/src/player.cpp
index c0736e8..9f2b61c 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -249,7 +249,7 @@ void Player::DrawHUD(const Frame* cam_frame) {
 }
 
 void Player::DrawTargetSquare(void) {
-  if(GetTarget()) {
+  if(GetTarget() && GetTarget()->IsOnscreen()) {
     glPushAttrib(GL_CURRENT_BIT | GL_LINE_BIT);
     glColor3f(0.0f, 1.0f, 0.0f);
     glLineWidth(2.0f);
diff --git a/src/sbre/Makefile.am b/src/sbre/Makefile.am
index a6697d8..530b8d7 100644
--- a/src/sbre/Makefile.am
+++ b/src/sbre/Makefile.am
@@ -1,6 +1,6 @@
 #  Process this file with automake to produce Makefile.in
 
 noinst_LIBRARIES = libsbre.a
-libsbre_a_SOURCES = brender.cpp models.cpp collfunc.cpp primfunc.cpp simtriang.cpp transp.cpp jjvector.cpp
+libsbre_a_SOURCES = brender.cpp models.cpp primfunc.cpp simtriang.cpp transp.cpp jjvector.cpp collfunc.cpp
 
 include_HEADERS = fastmath.h sbre.h sbre_int.h sbre_models.h sbre_anim.h jjtypes.h jjvector.h
diff --git a/src/sector_view.cpp b/src/sector_view.cpp
index 08ef450..5e268ec 100644
--- a/src/sector_view.cpp
+++ b/src/sector_view.cpp
@@ -147,14 +147,14 @@ void SectorView::DrawSector(int sx, int sy) {
       glEnd();
 
       glPushMatrix();
-      glDepthRange(0.2, 1.2);
+      glDepthRange(0.2, 1.0);
       glColor3f(3, 3, 3);
       glCallList(m_gluDiskDlist);
       glPopMatrix();
     }
     /* Selected indicator. */
     if((sx == m_secx) && (sy == m_secy) && (num == m_selected)) {
-      glDepthRange(0.1, 1.1);
+      glDepthRange(0.1, 1.0);
       glColor3f(0, 0.8, 0);
       glScalef(2, 2, 2);
       glCallList(m_gluDiskDlist);