From 25c1b13bd47eff1b7c3fa1f0a6ea7de84a465c6f Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 16 Feb 2019 19:13:05 -0500 Subject: [PATCH] improve find tool handling with GoL, can now find specific life elements Reverts most of LBPHacker's previous commit, lol --- src/graphics/Renderer.cpp | 3 ++- src/gui/game/GameView.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index 033fe6dcf..7c4d793c7 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.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; diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index 873971d40..bff48f538 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -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();