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

Reverts most of LBPHacker's previous commit, lol
This commit is contained in:
jacob1 2019-02-16 19:13:05 -05:00
parent 4ff1dc0bc3
commit 25c1b13bd4
2 changed files with 5 additions and 4 deletions

View File

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

View File

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