summaryrefslogtreecommitdiff
path: root/asm/macros
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-11-18 23:20:05 -0500
committerGriffinR <griffin.g.richards@gmail.com>2021-11-18 23:20:05 -0500
commit42a83ee50e3364f3f7361dacb3d3616053f4c5bf (patch)
treea8dfc736e7f80312bf87ecca340e29c4abbd3d0d /asm/macros
parente66ea0cb996c70093fe3f250cafb7f1f87e84d4d (diff)
Use STR_VAR names for apprentice_buff and frontier_gettrainername
Diffstat (limited to 'asm/macros')
-rw-r--r--asm/macros/battle_frontier/apprentice.inc14
-rw-r--r--asm/macros/battle_frontier/frontier_util.inc8
2 files changed, 18 insertions, 4 deletions
diff --git a/asm/macros/battle_frontier/apprentice.inc b/asm/macros/battle_frontier/apprentice.inc
index 83871880b..9eb5f9ea8 100644
--- a/asm/macros/battle_frontier/apprentice.inc
+++ b/asm/macros/battle_frontier/apprentice.inc
@@ -94,11 +94,19 @@
@ Buffer some APPRENTICE_BUFF_* string to the given stringvar (0 for STR_VAR_1, 1 for STR_VAR_2, 2 for STR_VAR_3)
.macro apprentice_buff stringvar:req, tobuff:req
setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING
- setvar VAR_0x8005, \stringvar
+ .if \stringvar == STR_VAR_1
+ setvar VAR_0x8005, 0
+ .elseif \stringvar == STR_VAR_2
+ setvar VAR_0x8005, 1
+ .elseif \stringvar == STR_VAR_3
+ setvar VAR_0x8005, 2
+ .else
+ setvar VAR_0x8005, \stringvar
+ .endif
.if \tobuff >= VARS_START
- copyvar VAR_0x8006, \tobuff
+ copyvar VAR_0x8006, \tobuff
.else
- setvar VAR_0x8006, \tobuff
+ setvar VAR_0x8006, \tobuff
.endif
special CallApprenticeFunction
.endm
diff --git a/asm/macros/battle_frontier/frontier_util.inc b/asm/macros/battle_frontier/frontier_util.inc
index def5b4d1c..c875fcdde 100644
--- a/asm/macros/battle_frontier/frontier_util.inc
+++ b/asm/macros/battle_frontier/frontier_util.inc
@@ -136,7 +136,13 @@
@ Buffer the name of gTrainerBattleOpponent_A in STR_VAR_1 (0) or STR_VAR_2 (1)
.macro frontier_gettrainername stringVar:req
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_BUFFER_TRAINER_NAME
- setvar VAR_0x8005, \stringVar
+ .if \stringVar == STR_VAR_1
+ setvar VAR_0x8005, 0
+ .elseif \stringVar == STR_VAR_2
+ setvar VAR_0x8005, 1
+ .else
+ setvar VAR_0x8005, \stringVar
+ .endif
special CallFrontierUtilFunc
.endm