[Fix] Targetting bug when labels enabled.

[Fix] Bug also in docking..
This commit is contained in:
Allanis 2017-12-24 18:49:26 +00:00
parent 50726de102
commit 5c87fa475d
3 changed files with 3 additions and 3 deletions

View File

@ -177,7 +177,7 @@ void Player::DrawHUD(const Frame* cam_frame) {
Gui::Screen::EnterOrtho(); Gui::Screen::EnterOrtho();
glColor3f(.7, .7, .7); glColor3f(.7, .7, .7);
if(L3D::world_view->GetShowLabels()) { {
for(std::list<Body*>::iterator i = Space::bodies.begin(); i != Space::bodies.end(); ++i) { for(std::list<Body*>::iterator i = Space::bodies.begin(); i != Space::bodies.end(); ++i) {
if((L3D::GetCamType() != L3D::CAM_EXTERNAL) && (*i == this)) continue; if((L3D::GetCamType() != L3D::CAM_EXTERNAL) && (*i == this)) continue;
Body* b = *i; Body* b = *i;
@ -188,6 +188,7 @@ void Player::DrawHUD(const Frame* cam_frame) {
&_pos.x, &_pos.y, &_pos.z)) { &_pos.x, &_pos.y, &_pos.z)) {
b->SetProjectedPos(_pos); b->SetProjectedPos(_pos);
b->SetOnscreen(true); b->SetOnscreen(true);
if(L3D::world_view->GetShowLabels()) Gui::Screen::RenderLabel(b->GetLabel(), _pos.x, _pos.y);
} else } else
b->SetOnscreen(false); b->SetOnscreen(false);
} }

View File

@ -175,12 +175,12 @@ void Ship::SetDockedWith(SpaceStation* s) {
Enable(); Enable();
m_dockedWith = 0; m_dockedWith = 0;
} else { } else {
m_dockedWith = s; m_dockedWith = s;
dockingTimer = 0.0f; dockingTimer = 0.0f;
SetVelocity(vector3d(0, 0, 0)); SetVelocity(vector3d(0, 0, 0));
SetAngVelocity(vector3d(0, 0, 0)); SetAngVelocity(vector3d(0, 0, 0));
Disable();
} }
} }

View File

@ -92,7 +92,6 @@ bool SpaceStation::OnCollision(Body* b, Uint32 flags) {
if(b->GetType() == Object::SHIP) { if(b->GetType() == Object::SHIP) {
Ship* s = static_cast<Ship*>(b); Ship* s = static_cast<Ship*>(b);
if((!s->GetDockedWith()) && (s->GetDockingTimer() != 0.0f)) { if((!s->GetDockedWith()) && (s->GetDockingTimer() != 0.0f)) {
s->Disable();
s->SetDockedWith(this); s->SetDockedWith(this);
printf("Docking!\n"); printf("Docking!\n");
} }