Skip to content

Commit

Permalink
Fix inverted updateLookDirection
Browse files Browse the repository at this point in the history
  • Loading branch information
NRH-AA committed Sep 17, 2024
1 parent 9489e3d commit d2f08b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1906,8 +1906,8 @@ void Monster::updateLookDirection()
if (attackedCreature) {
const Position& pos = getPosition();
const Position& attackedCreaturePos = attackedCreature->getPosition();
int32_t offsetx = pos.getOffsetX(attackedCreaturePos);
int32_t offsety = pos.getOffsetY(attackedCreaturePos);
int32_t offsetx = attackedCreaturePos.getOffsetX(pos);
int32_t offsety = attackedCreaturePos.getOffsetY(pos);

int32_t dx = std::abs(offsetx);
int32_t dy = std::abs(offsety);
Expand Down

0 comments on commit d2f08b2

Please sign in to comment.