Skip to content
Permalink
Browse files

improve find tool handling with GoL, can now find specific life elements

Reverts most of LBPHacker's previous commit, lol
  • Loading branch information...
jacob1 committed Feb 17, 2019
1 parent 4ff1dc0 commit 25c1b13bd47eff1b7c3fa1f0a6ea7de84a465c6f
Showing with 5 additions and 4 deletions.
  1. +2 −1 src/graphics/Renderer.cpp
  2. +3 −3 src/gui/game/GameView.cpp
@@ -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;
@@ -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();
}
}

@@ -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();

0 comments on commit 25c1b13

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.