Skip to content

Commit

Permalink
reset/center system map when 'c' pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
robn committed Feb 2, 2011
1 parent 722426a commit e36584f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/SectorView.cpp
Expand Up @@ -253,6 +253,15 @@ void SectorView::Update()
{
const float frameTime = Pi::GetFrameTime();

int playerLocSecX, playerLocSecY, playerLocSysIdx;
Pi::currentSystem->GetPos(&playerLocSecX, &playerLocSecY, &playerLocSysIdx);

if (Pi::KeyState(SDLK_c)) {
GotoSystem(playerLocSecX, playerLocSecY, playerLocSysIdx);
m_rot_x = m_rot_z = 0;
m_zoom = 1.2;
}

float moveSpeed = 1.0;
if (Pi::KeyState(SDLK_LSHIFT)) moveSpeed = 100.0;

Expand Down Expand Up @@ -301,8 +310,6 @@ void SectorView::Update()
}
}

int playerLocSecX, playerLocSecY, playerLocSysIdx;
Pi::currentSystem->GetPos(&playerLocSecX, &playerLocSecY, &playerLocSysIdx);
StarSystem *sys = Pi::GetSelectedSystem();

if (sys->GetLocation() != m_lastShownLoc) {
Expand Down

0 comments on commit e36584f

Please sign in to comment.