--- deliantra/server/common/holy.C 2007/06/04 13:04:00 1.11 +++ deliantra/server/common/holy.C 2007/06/05 13:05:02 1.12 @@ -30,21 +30,6 @@ #include #include -//TODO: make a constructor -static godlink * -init_godslist (void) -{ - godlink *gl = new godlink; - - // name=NULL; /* how to describe the god to the player */ - // arch=NULL; /* pointer to the archetype of this god */ - // id=0; /* id of the god */ - // pantheon=NULL; /* the group to which the god belongs (not implemented) */ - // next=NULL; /* next god in this linked list */ - - return gl; -} - /* init_gods() - this takes a look at all of the archetypes to find * the objects which correspond to the GODS (type GOD) */ @@ -64,18 +49,23 @@ void add_god_to_list (archetype *god_arch) { - godlink *god; - if (!god_arch) { LOG (llevError, "ERROR: Tried to add null god to list!\n"); return; } - god = init_godslist (); + godlink *god = new godlink; + + // name=NULL; /* how to describe the god to the player */ + // arch=NULL; /* pointer to the archetype of this god */ + // id=0; /* id of the god */ + // pantheon=NULL; /* the group to which the god belongs (not implemented) */ + // next=NULL; /* next god in this linked list */ god->arch = god_arch; god->name = god_arch->object::name; + if (!first_god) god->id = 1; else @@ -83,6 +73,7 @@ god->id = first_god->id + 1; god->next = first_god; } + first_god = god; #ifdef DEBUG_GODS