From b6c2bf9050a56841bb5a82549fd36a98b03e2f41 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Sat, 7 Apr 2012 16:16:17 +0200 Subject: Lua: Remove unnecessary dynamism from "powers" handling --- src/powers.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/powers.c') 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]; } -- cgit v1.2.3