From 476fce2911ddcbc0c3e7657de701cc9591513246 Mon Sep 17 00:00:00 2001 From: Rtch90 Date: Sun, 24 Dec 2017 18:49:26 +0000 Subject: [PATCH] [Fix] Targetting bug when labels enabled. [Fix] Bug also in docking.. --- src/player.cpp | 3 ++- src/ship.cpp | 2 +- src/space_station.cpp | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/player.cpp b/src/player.cpp index db28bf6..a278198 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -177,7 +177,7 @@ void Player::DrawHUD(const Frame* cam_frame) { Gui::Screen::EnterOrtho(); glColor3f(.7, .7, .7); - if(L3D::world_view->GetShowLabels()) { + { for(std::list::iterator i = Space::bodies.begin(); i != Space::bodies.end(); ++i) { if((L3D::GetCamType() != L3D::CAM_EXTERNAL) && (*i == this)) continue; Body* b = *i; @@ -188,6 +188,7 @@ void Player::DrawHUD(const Frame* cam_frame) { &_pos.x, &_pos.y, &_pos.z)) { b->SetProjectedPos(_pos); b->SetOnscreen(true); + if(L3D::world_view->GetShowLabels()) Gui::Screen::RenderLabel(b->GetLabel(), _pos.x, _pos.y); } else b->SetOnscreen(false); } diff --git a/src/ship.cpp b/src/ship.cpp index 8601e7c..7166c46 100644 --- a/src/ship.cpp +++ b/src/ship.cpp @@ -175,12 +175,12 @@ void Ship::SetDockedWith(SpaceStation* s) { Enable(); m_dockedWith = 0; - } else { m_dockedWith = s; dockingTimer = 0.0f; SetVelocity(vector3d(0, 0, 0)); SetAngVelocity(vector3d(0, 0, 0)); + Disable(); } } diff --git a/src/space_station.cpp b/src/space_station.cpp index 51a1a7c..60a0c04 100644 --- a/src/space_station.cpp +++ b/src/space_station.cpp @@ -92,7 +92,6 @@ bool SpaceStation::OnCollision(Body* b, Uint32 flags) { if(b->GetType() == Object::SHIP) { Ship* s = static_cast(b); if((!s->GetDockedWith()) && (s->GetDockingTimer() != 0.0f)) { - s->Disable(); s->SetDockedWith(this); printf("Docking!\n"); }