Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

lastStepCost diagonal to 1 #14

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,10 @@ void Creature::onCreatureMove(Creature* creature, const Tile* newTile, const Pos
if (!teleport) {
if (oldPos.z != newPos.z) {
//floor change extra cost
lastStepCost = 2;
lastStepCost = 1;
} else if (Position::getDistanceX(newPos, oldPos) >= 1 && Position::getDistanceY(newPos, oldPos) >= 1) {
//diagonal extra cost
lastStepCost = 3;
lastStepCost = 2;
}
} else {
stopEventWalk();
Expand Down