Browse Source

Fix preview frame when player can't walk to desired location

pull/3965/head
obligaron 4 years ago committed by Anders Jenbo
parent
commit
6d7334886d
  1. 7
      Source/player.cpp

7
Source/player.cpp

@ -2224,7 +2224,12 @@ void Player::UpdatePreviewCelSprite(_cmd_id cmdId, Point point, uint16_t wParam1
if (minimalWalkDistance >= 0 && position.future != point) {
int8_t testWalkPath[MAX_PATH_LENGTH];
if (FindPath([this](Point position) { return PosOkPlayer(*this, position); }, position.future, point, testWalkPath) >= minimalWalkDistance) {
int steps = FindPath([this](Point position) { return PosOkPlayer(*this, position); }, position.future, point, testWalkPath);
if (steps == 0) {
// Can't walk to desired location => stand still
return;
}
if (steps >= minimalWalkDistance) {
graphic = player_graphic::Walk;
switch (testWalkPath[0]) {
case WALK_N:

Loading…
Cancel
Save