shithub: pokecrystal

Download patch

ref: 7558b98a810bee3a51c8c0553b52e8a93f853268
parent: 6a6ba10315baf4b0092c6d952a2f0cb502b6ac8e
author: Rangi <[email protected]>
date: Sat Mar 21 10:03:38 EDT 2020

Revert the broken CheckTypeMatchup bugfix simplification from 5728d0141793d832476b3f7b5c0844166fa7c242

--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -901,8 +901,12 @@
  	ld hl, wEnemyMonType1
  	ldh a, [hBattleTurn]
  	and a
-	jr z, CheckTypeMatchup
+-	jr z, CheckTypeMatchup
++	jr z, .get_type
  	ld hl, wBattleMonType1
++.get_type
++	ld a, BATTLE_VARS_MOVE_TYPE
++	call GetBattleVar ; preserves hl, de, and bc
  CheckTypeMatchup:
 -; There is an incorrect assumption about this function made in the AI related code: when
 -; the AI calls CheckTypeMatchup (not BattleCheckTypeMatchup), it assumes that placing the
@@ -910,8 +914,6 @@
 -; this assumption is incorrect. A simple fix would be to load the move type for the
 -; current move into a in BattleCheckTypeMatchup, before falling through, which is
 -; consistent with how the rest of the code assumes this code works like.
-+	ld a, BATTLE_VARS_MOVE_TYPE
-+	call GetBattleVar ; preserves hl, de, and bc
  	push hl
  	push de
  	push bc