X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectTarget.cpp;h=9c50991bf00c26b9deb34acc83b61f3b4f4b7152;hb=d872d756e64b8f1f57cba64ae19f479f8eab3927;hp=dedf8e77b193ce3f78bea9e67db1082752722af2;hpb=3c72a71fbf6de96333a641051a20c6bf8b3a5df3;p=l2e.git diff --git a/src/battle/states/SelectTarget.cpp b/src/battle/states/SelectTarget.cpp index dedf8e7..9c50991 100644 --- a/src/battle/states/SelectTarget.cpp +++ b/src/battle/states/SelectTarget.cpp @@ -90,7 +90,8 @@ void SelectTarget::Render(SDL_Surface *screen) { void SelectTarget::RenderCursors(SDL_Surface *screen, const geometry::Vector &offset) { // TODO: this should be related to the enemy's width - Vector cursorOffset(0, 0); + // offset the cursor by 1/8th to the left and bottom + Vector cursorOffset(cursorIcon->Width() / -8, cursorIcon->Height() / 8); Vector indicatorOffset(0, 0); vector > positions; if (selection->TargetsEnemies()) { @@ -100,6 +101,8 @@ void SelectTarget::RenderCursors(SDL_Surface *screen, const geometry::Vector::size_type i(0), end(battle->Heroes().size()); i < end; ++i) { Vector positionCorrection(cursorIcon->Width() / 2, battle->HeroTagAt(i).HeroSprite()->Height() - cursorIcon->Height() / 2); + // indicator offsets are inverted for heroes + positionCorrection -= cursorOffset; positions.push_back(battle->HeroTagPositionAt(i) + battle->HeroTagAt(i).HeroOffset() + positionCorrection); } }