summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 7fbbcd0d5..1725d8c65 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -7329,15 +7329,23 @@ int battle_set_value(const char* w1, const char* w2)
return 1;
}
-int battle_get_value(const char* w1)
+bool battle_get_value(const char *w1, int *value)
{
int i;
- nullpo_retr(1, w1);
+
+ nullpo_retr(false, w1);
+ nullpo_retr(false, value);
+
ARR_FIND(0, ARRAYLENGTH(battle_data), i, strcmpi(w1, battle_data[i].str) == 0);
- if (i == ARRAYLENGTH(battle_data))
- return 0; // not found
- else
- return *battle_data[i].val;
+ if (i == ARRAYLENGTH(battle_data)) {
+ if (HPM->getBattleConf(w1,value))
+ return true;
+ } else {
+ *value = *battle_data[i].val;
+ return true;
+ }
+
+ return false;
}
void battle_set_defaults(void) {