summaryrefslogtreecommitdiff
path: root/engine/load_mon_data.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/load_mon_data.asm')
-rw-r--r--engine/load_mon_data.asm21
1 files changed, 20 insertions, 1 deletions
diff --git a/engine/load_mon_data.asm b/engine/load_mon_data.asm
index a71a81c5..e708113f 100644
--- a/engine/load_mon_data.asm
+++ b/engine/load_mon_data.asm
@@ -15,7 +15,7 @@ LoadMonData_:
ld a, [wWhichPokemon]
ld e, a
- callab GetMonSpecies
+ call GetMonSpecies
.GetMonHeader
ld a, [wcf91]
@@ -47,3 +47,22 @@ LoadMonData_:
ld de, wLoadedMon
ld bc, wPartyMon2 - wPartyMon1
jp CopyData
+
+; get species of mon e in list [wMonDataLocation] for LoadMonData
+GetMonSpecies:
+ ld hl, wPartySpecies
+ ld a, [wMonDataLocation]
+ and a
+ jr z, .getSpecies
+ dec a
+ jr z, .enemyParty
+ ld hl, wBoxSpecies
+ jr .getSpecies
+.enemyParty
+ ld hl, wEnemyPartyMons
+.getSpecies
+ ld d, 0
+ add hl, de
+ ld a, [hl]
+ ld [wcf91], a
+ ret