From 5e05a0db617803216a36df71fde77a49287242f5 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 29 May 2019 23:09:50 +0200 Subject: [PATCH] dual:: if there is no effect, do no move rather than double swing --- game.cpp | 3 ++- multigame.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/game.cpp b/game.cpp index acd9a703..31c484b6 100644 --- a/game.cpp +++ b/game.cpp @@ -8025,6 +8025,7 @@ bool movepcto(int d, int subdir, bool checkonly) { c2->wall == waMirrorWall; if(attackable && markOrb(itOrbAether) && c2->wall != waMirrorWall) attackable = false; + bool nm; nm = attackable; if(forcedmovetype == fmAttack) attackable = true; attackable = attackable && (!c2->monst || isFriendly(c2)); attackable = attackable && !nonAdjacentPlayer(cwt.at,c2); @@ -8035,7 +8036,7 @@ bool movepcto(int d, int subdir, bool checkonly) { if(!checkonly && errormsgs) wouldkill("%The1 would get you!"); return false; } - if(checkonly) { nextmovetype = lmAttack; return true; } + if(checkonly) { nextmovetype = nm ? lmAttack : lmSkip; return true; } if(c2->wall == waSmallTree) { drawParticles(c2, winf[c2->wall].color, 4); addMessage(XLAT("You chop down the tree.")); diff --git a/multigame.cpp b/multigame.cpp index 2d6d4382..de6dcb8e 100644 --- a/multigame.cpp +++ b/multigame.cpp @@ -121,11 +121,13 @@ namespace dual { } bool lms[2][5]; + eLastmovetype lmt[2][5]; for(int k=0; k<2; k++) { switch_to(k); for(eForcemovetype fm: { fmMove, fmAttack, fmInstant, fmActivate }) { forcedmovetype = fm; lms[k][fm] = movepcto(fm == fmMove ? d : 0, subdir, true); + lmt[k][fm] = nextmovetype; println(hlog, k, int(fm), " -> ", lms[k][fm]); forcedmovetype = fmSkip; for(int i=0; i