Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CF: bug fix for preset altar gods




	I noticed that the current 0.93.5 code doesnt 
	load altars with preset gods properly (if you
	design a map, or an altar archetype with the 
	altar->title name set to a certain god, the
	baptise_altar fctn *isnt* supposed to reset the
	value). 

	Here follows a minor patch. There appears to 
	be a minor (typo level) bug in altar names (
	eg altar->name field isnt being used properly...
	but I think thats in the praying code). Ill 
	try to fix that later if I can get the time.

					-b.t.

*** holy.c.orig	Sun Oct  5 21:06:08 1997
--- holy.c	Sun Oct  5 21:08:08 1997
***************
*** 62,86 ****
   * god in question, then set the title for later use. -b.t.
   */
   
  int baptize_altar(object *op) {
     char buf[MAX_BUF];
-    godlink *god=get_rand_god();
     
!    if(!god||!god->name) {
          LOG(llevError,"baptise_altar(): bizarre nameless god!\n");
          return 0;
!    }   
!    /* if the object name hasnt' been changed, we give it a random god */
!    if(!strcmp(op->name,op->arch->clone.name)) {
          if(op->name!=NULL) free_string(op->name);
          sprintf(buf,"%s of %s",op->name,god->name);
          op->name = add_string(buf);
!    }
!    if(!op->title) {
!         op->title=add_string(god->name);
!         return 1;
     }
     return 0;
  }
   
  godlink * get_rand_god ( void ) {
--- 62,88 ----
   * god in question, then set the title for later use. -b.t.
   */
   
  int baptize_altar(object *op) {
     char buf[MAX_BUF];
     
!    /* if the title field is pre-set, then that altar is
!     * already dedicated. */
!    if(!op->title) {
!      godlink *god=get_rand_god();
!      if(!god||!god->name) {
          LOG(llevError,"baptise_altar(): bizarre nameless god!\n");
          return 0;
!      }   
!      /* if the object name hasnt' been changed, we tack on the gods name */
!      if(!strcmp(op->name,op->arch->clone.name)) {
          if(op->name!=NULL) free_string(op->name);
          sprintf(buf,"%s of %s",op->name,god->name);
          op->name = add_string(buf);
!      }
!      op->title=add_string(god->name);
!      return 1;
     }
     return 0;
  }
   
  godlink * get_rand_god ( void ) {
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]