]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/HeroTag.cpp
changed battle positions from bottom-center to center
[l2e.git] / src / battle / HeroTag.cpp
index d50b4132d85860f7556041794eac260793c92480..f6682df4e5da9df1b424d65ceb3ca7ee07d96d71 100644 (file)
@@ -93,13 +93,13 @@ void HeroTag::Render(SDL_Surface *screen, int width, int height, Point<int> posi
        }
 
        // hero
-       HeroSprite()->Draw(screen, position + HeroOffset(), 0, battle->HeroAt(index).Health() > 0 ? 0 : 2);
+       HeroSprite()->DrawCenter(screen, position + HeroOffset(), 0, battle->HeroAt(index).Health() > 0 ? 0 : 2);
 }
 
 Vector<int> HeroTag::HeroOffset() const {
        return Vector<int>(
-                       (index % 2) ? battle->Res().normalFont->CharWidth() : 10 * battle->Res().normalFont->CharWidth(),
-                       battle->Res().normalFont->CharWidth());
+                       ((index % 2) ? battle->Res().normalFont->CharWidth() : 10 * battle->Res().normalFont->CharWidth()) + HeroSprite()->Width() / 2,
+                       battle->Res().normalFont->CharWidth() + HeroSprite()->Height() / 2);
 }
 
 }