shithub: pokecrystal

Download patch

ref: ee86b367662ab8f7a81a644c66f5bf14ead59ba8
parent: 4154f191e09404748de4faa3a63bcb51faf42c98
author: mid-kid <esteve.varela@gmail.com>
date: Fri Feb 15 12:21:51 EST 2019

wNumActiveBattleAnims → wLastAnimObjectIndex

This variable never decrements, it only increments to give each battle
animation a different, and incremental "index".

--- a/engine/battle_anims/bg_effects.asm
+++ b/engine/battle_anims/bg_effects.asm
@@ -416,7 +416,7 @@
 .zero
 	call BGEffect_CheckFlyDigStatus
 	jr z, .not_flying_digging
-	ld hl, wNumActiveBattleAnims
+	ld hl, wLastAnimObjectIndex
 	inc [hl]
 	call EndBattleBGEffect
 	ret
@@ -483,7 +483,7 @@
 .zero
 	call BGEffect_CheckFlyDigStatus
 	jr z, .not_flying_digging
-	ld hl, wNumActiveBattleAnims
+	ld hl, wLastAnimObjectIndex
 	inc [hl]
 	call EndBattleBGEffect
 	ret
--- a/engine/battle_anims/core.asm
+++ b/engine/battle_anims/core.asm
@@ -15,7 +15,7 @@
 .done
 	ld c, l
 	ld b, h
-	ld hl, wNumActiveBattleAnims
+	ld hl, wLastAnimObjectIndex
 	inc [hl]
 	call InitBattleAnimation
 	ret
@@ -38,7 +38,7 @@
 	ld d, h
 	ld hl, BATTLEANIMSTRUCT_INDEX
 	add hl, bc
-	ld a, [wNumActiveBattleAnims]
+	ld a, [wLastAnimObjectIndex]
 	ld [hli], a ; Index
 	ld a, [de]
 	inc de
--- a/wram.asm
+++ b/wram.asm
@@ -3045,7 +3045,7 @@
 wBGEffect5:: battle_bg_effect wBGEffect5
 wActiveBGEffectsEnd::
 
-wNumActiveBattleAnims:: db ; d40e
+wLastAnimObjectIndex:: db ; d40e
 
 wBattleAnimFlags:: db ; d40f
 wBattleAnimAddress:: dw ; d410