diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-04-07 16:16:17 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-04-07 17:49:18 +0200 |
commit | b6c2bf9050a56841bb5a82549fd36a98b03e2f41 (patch) | |
tree | 3f5f7d75af05de6306ad7fb6ce9155a663e91c5d /src/powers.c | |
parent | 838246d8d5d9febf38452f82692b25d7dc092ef3 (diff) |
Lua: Remove unnecessary dynamism from "powers" handling
Diffstat (limited to 'src/powers.c')
-rw-r--r-- | src/powers.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/powers.c b/src/powers.c index 2f0206aa..613968df 100644 --- a/src/powers.c +++ b/src/powers.c @@ -1297,11 +1297,10 @@ static power_type* select_power(int *x_idx) int max = 0, i, start = 0; power_type* ret; bool_ mode = FALSE; - int *p; + int p[POWER_MAX]; - C_MAKE(p, power_max, int); /* Count the max */ - for (i = 0; i < power_max; i++) + for (i = 0; i < POWER_MAX; i++) { if (p_ptr->powers[i]) { @@ -1375,8 +1374,6 @@ static power_type* select_power(int *x_idx) character_icky = FALSE; } - C_FREE(p, power_max, int); - return ret; } @@ -1390,7 +1387,7 @@ void do_cmd_power() /* Get the skill, if available */ if (repeat_pull(&x_idx)) { - if ((x_idx < 0) || (x_idx >= power_max)) return; + if ((x_idx < 0) || (x_idx >= POWER_MAX)) return; x_ptr = &powers_type[x_idx]; push = FALSE; } @@ -1398,7 +1395,7 @@ void do_cmd_power() else { x_idx = command_arg - 1; - if ((x_idx < 0) || (x_idx >= power_max)) return; + if ((x_idx < 0) || (x_idx >= POWER_MAX)) return; x_ptr = &powers_type[x_idx]; } |