Browse Source

♻️ Leverage 'IsWalking' function for monster walking checks

pull/2774/head
Juliano Leal Goncalves 5 years ago committed by Anders Jenbo
parent
commit
314ae59828
  1. 2
      Source/monster.cpp
  2. 2
      Source/sync.cpp

2
Source/monster.cpp

@ -4189,7 +4189,7 @@ void GolumAi(int i)
if (golem._mmode == MM_DEATH
|| golem._mmode == MM_SPSTAND
|| (golem._mmode >= MM_WALK && golem._mmode <= MM_WALK3)) {
|| golem.IsWalking()) {
return;
}

2
Source/sync.cpp

@ -172,7 +172,7 @@ void SyncMonster(int pnum, const TSyncMonster *p)
}
if (monster.position.tile.WalkingDistance({ p->_mx, p->_my }) <= 2) {
if (monster._mmode < MM_WALK || monster._mmode > MM_WALK3) {
if (!monster.IsWalking()) {
Direction md = GetDirection(monster.position.tile, { p->_mx, p->_my });
if (DirOK(ndx, md)) {
M_ClearSquares(ndx);

Loading…
Cancel
Save