diff options
author | Hyperdriveguy <hyperdriveguy@gmail.com> | 2018-07-20 17:39:53 -0700 |
---|---|---|
committer | Hyperdriveguy <hyperdriveguy@gmail.com> | 2018-07-20 17:39:53 -0700 |
commit | 57fc81d44e1f26b8895d37c9d847400851a8f8b4 (patch) | |
tree | 90e16f848e085a57ef28dbb31d4347dd8302dfea /docs/bugs_and_glitches.md | |
parent | 53bcd8f46ca4f78381af70f55d03f3180be277de (diff) |
Add Counter and Mirror Coat bugfix
Diffstat (limited to 'docs/bugs_and_glitches.md')
-rw-r--r-- | docs/bugs_and_glitches.md | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index f7675ae78..941b4bbac 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -246,7 +246,35 @@ DefenseDownHit: ([Video](https://www.youtube.com/watch?v=uRYyzKRatFk)) -*To do:* Identify specific code causing this bug and fix it. +This is a bug with `BattleCommand_Counter` in [engine/battle/move_effects/counter.asm](/engine/battle/move_effects/counter.asm) and `BattleCommand_MirrorCoat` in [engine/battle/move_effects/mirror_coat.asm](/engine/battle/move_effects/mirror_coat.asm): + +```asm + ; BUG: Move should fail with all non-damaging battle actions + ld hl, wCurDamage + ld a, [hli] + or [hl] + ret z +``` + +**Fix:** + +```diff + ld hl, wCurDamage + ld a, [hli] + or [hl] +- ret z ++ jp z, .failed +``` + +Add this to the end of each file: + +```diff ++.failed ++ ld a, 1 ++ ld [wEffectFailed], a ++ and a ++ ret +``` ## A Disabled but PP Up–enhanced move may not trigger Struggle |