… | |
… | |
28 | void |
28 | void |
29 | init_gods (void) |
29 | init_gods (void) |
30 | { |
30 | { |
31 | archetype *at = NULL; |
31 | archetype *at = NULL; |
32 | |
32 | |
33 | LOG (llevDebug, "Initializing gods..."); |
33 | LOG (llevDebug, "Initialising gods...\n"); |
34 | for (at = first_archetype; at != NULL; at = at->next) |
34 | for (at = first_archetype; at != NULL; at = at->next) |
35 | if (at->clone.type == GOD) |
35 | if (at->clone.type == GOD) |
36 | add_god_to_list (at); |
36 | add_god_to_list (at); |
37 | |
37 | |
38 | LOG (llevDebug, "done.\n"); |
38 | LOG (llevDebug, "done.\n"); |
… | |
… | |
105 | { |
105 | { |
106 | godlink *god = first_god; |
106 | godlink *god = first_god; |
107 | int i; |
107 | int i; |
108 | |
108 | |
109 | if (god) |
109 | if (god) |
110 | for (i = RANDOM () % (god->id) + 1; god; god = god->next) |
110 | for (i = rndm (god->id) + 1; god; god = god->next) |
111 | if (god->id == i) |
111 | if (god->id == i) |
112 | break; |
112 | break; |
113 | |
113 | |
114 | if (!god) |
114 | if (!god) |
115 | LOG (llevError, "get_rand_god(): can't find a random god!\n"); |
115 | LOG (llevError, "get_rand_god(): can't find a random god!\n"); |
|
|
116 | |
116 | return god; |
117 | return god; |
117 | } |
118 | } |
118 | |
119 | |
119 | /* pntr_to_god_obj() - returns a pointer to the object |
120 | /* pntr_to_god_obj() - returns a pointer to the object |
120 | * We need to be VERY carefull about using this, as we |
121 | * We need to be VERY carefull about using this, as we |