Skip to content

Commit

Permalink
improve find tool handling with GoL, can now find specific life elements
Browse files Browse the repository at this point in the history
Reverts most of LBPHacker's previous commit, lol
  • Loading branch information
jacob1 committed Feb 17, 2019
1 parent 4ff1dc0 commit 25c1b13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/graphics/Renderer.cpp
Expand Up @@ -1422,7 +1422,8 @@ void Renderer::render_parts()

if (findingElement)
{
if (findingElement == parts[i].type)
if (TYP(findingElement) == parts[i].type &&
(parts[i].type != PT_LIFE || (ID(findingElement) == parts[i].ctype)))
{
colr = firer = 255;
colg = fireg = colb = fireb = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/gui/game/GameView.cpp
Expand Up @@ -715,7 +715,7 @@ void GameView::NotifyActiveToolsChanged(GameModel * sender)
if (!active->GetIdentifier().Contains("_PT_"))
ren->findingElement = 0;
else
ren->findingElement = sender->GetActiveTool(0)->GetToolID() & ((1 << PMAPBITS) - 1);
ren->findingElement = sender->GetActiveTool(0)->GetToolID();
}
}

Expand Down Expand Up @@ -1509,10 +1509,10 @@ void GameView::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl,
if (ctrl)
{
Tool *active = c->GetActiveTool(0);
if (!active->GetIdentifier().Contains("_PT_") || (ren->findingElement == (active->GetToolID() & ((1 << PMAPBITS) - 1))))
if (!active->GetIdentifier().Contains("_PT_") || (ren->findingElement == active->GetToolID()))
ren->findingElement = 0;
else
ren->findingElement = active->GetToolID() & ((1 << PMAPBITS) - 1);
ren->findingElement = active->GetToolID();
}
else
c->FrameStep();
Expand Down

0 comments on commit 25c1b13

Please sign in to comment.