From f802db8cbf123d07c8a373b0cfc4188de34f386e Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Wed, 11 Apr 2012 17:38:55 +0200 Subject: Lua: Gods: Move Theme god definitions to C --- src/birth.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/birth.c') diff --git a/src/birth.c b/src/birth.c index 243f080e..274b50bf 100644 --- a/src/birth.c +++ b/src/birth.c @@ -2331,16 +2331,17 @@ static bool_ player_birth_aux_ask() } else { - int *choice; + int choice[MAX_GODS]; int max = 0; - C_MAKE(choice, max_gods, int); - /* Get the list of possible gods */ - for (n = 0; n < max_gods; n++) + for (n = 0; n < MAX_GODS; n++) { - if ((cp_ptr->gods | spp_ptr->gods) & BIT(n)) + if (god_enabled(&deity_info[n]) && + ((cp_ptr->gods | spp_ptr->gods) & BIT(n))) + { choice[max++] = n; + } } if (!max) @@ -2368,8 +2369,6 @@ static bool_ player_birth_aux_ask() if (c == 'Q') quit(NULL); if (c == 'S') { - C_FREE(choice, max_gods, int); - return (FALSE); } if (c == '*') @@ -2424,8 +2423,6 @@ static bool_ player_birth_aux_ask() else bell(); } - C_FREE(choice, max_gods, int); - /* Set god */ p_ptr->pgod = k; p_ptr->grace = 0; -- cgit v1.2.3