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

CF: oops...




	If you are about to apply the last patch,..don't! If 
	you already did.. no problem. I inadvertently included
	some code from my alchemy hack in the last patch. The
	real patch to apply is the following one. 

	The reason the last patch wont cause problems, is that 
	it patches a part of the code w/ is currently ifdef 0.

					cheers, b.t.

*** ../../tarfiles/crossfire-0.92.3/common/readable.c	Thu Mar  7 03:38:10 1996
--- ../common/readable.c	Sun Mar 31 04:02:07 1996
***************
*** 94,103 ****
--- 94,104 ----
          default:
            strcpy(msgbuf, msgfile_msg(level,book_buf_size));
            break;
    }
   
+   strcat(msgbuf,"\n"); /* safety -- we get ugly map saves/crashes w/o this */ 
    if(strlen(msgbuf)>1) {
    	if(book->msg) free_string(book->msg);
  	book->msg=add_string(msgbuf);
    }
  }
***************
*** 315,326 ****
    strcpy(retbuf,"This beastuary contains:");
  
    /* lets print info on as many monsters as will fit in our 
     * document. 
     */
!   while((tmp=get_random_mon(level*3))) { 
  
        /* monster description */
        sprintf(tmpbuf,"\n---\n%s",mon_desc(tmp));
  
        if(!book_overflow(retbuf,tmpbuf,booksize)) 
          	strcat(retbuf,tmpbuf);
--- 327,339 ----
    strcpy(retbuf,"This beastuary contains:");
  
    /* lets print info on as many monsters as will fit in our 
     * document. 
     */
!   while((tmp=get_random_mon(level*3))!=NULL) { 
  
+       LOG(llevDebug,"Got monster: %s",tmp->name);
        /* monster description */
        sprintf(tmpbuf,"\n---\n%s",mon_desc(tmp));
  
        if(!book_overflow(retbuf,tmpbuf,booksize)) 
          	strcat(retbuf,tmpbuf);
***************
*** 461,476 ****
    if(!did_first_sp) 
  	if(RANDOM()%4) /* usually, lets make a recursive call... */
  	   sprintf(retbuf, spellpath_msg(level,booksize));
  	else /* give up, cause knowning no spells exist for path is info too. */
  	   strcat(retbuf,"\n - no known spells exist -\n");
- #ifdef BOOK_MSG_DEBUG
    else { 
       LOG(llevDebug,"\n spellpath_msg() created strng: %d\n",strlen(retbuf));
       fprintf(logfile," MADE THIS: path=%d pray=%d\n%s\n",path,prayers,retbuf);
-   }
  #endif
    return retbuf;
  }
  
  /* artifact_msg() - generate a message detailing the properties
   * of 1-6 artifacts drawn sequentially from the artifact list.
--- 474,490 ----
    if(!did_first_sp) 
  	if(RANDOM()%4) /* usually, lets make a recursive call... */
  	   sprintf(retbuf, spellpath_msg(level,booksize));
  	else /* give up, cause knowning no spells exist for path is info too. */
  	   strcat(retbuf,"\n - no known spells exist -\n");
    else { 
+ #ifdef BOOK_MSG_DEBUG
       LOG(llevDebug,"\n spellpath_msg() created strng: %d\n",strlen(retbuf));
       fprintf(logfile," MADE THIS: path=%d pray=%d\n%s\n",path,prayers,retbuf);
  #endif
+      strcat(retbuf,"\n");
+   }
    return retbuf;
  }
  
  /* artifact_msg() - generate a message detailing the properties
   * of 1-6 artifacts drawn sequentially from the artifact list.
***************
*** 755,765 ****
          else if(strlen(buf)>1) strcat(retbuf,buf);
          level--;
    }
    if(strlen(retbuf)==introlen) { /* we got no information beyond the preamble! */
          strcat(retbuf," [Unfortunately the rest of the information is\n");
!         strcat(retbuf,"  hopelessly garbled!]\n ---");
    }
  #ifdef BOOK_MSG_DEBUG
    LOG(llevDebug,"\n god_info_msg() created strng: %d\n",strlen(retbuf));
    fprintf(logfile," MADE THIS:\n%s",retbuf);
  #endif
--- 769,779 ----
          else if(strlen(buf)>1) strcat(retbuf,buf);
          level--;
    }
    if(strlen(retbuf)==introlen) { /* we got no information beyond the preamble! */
          strcat(retbuf," [Unfortunately the rest of the information is\n");
!         strcat(retbuf,"  hopelessly garbled!]\n ---\n");
    }
  #ifdef BOOK_MSG_DEBUG
    LOG(llevDebug,"\n god_info_msg() created strng: %d\n",strlen(retbuf));
    fprintf(logfile," MADE THIS:\n%s",retbuf);
  #endif
***************
*** 766,776 ****
    return retbuf;
  }
   
  int book_overflow(char *buf1, char *buf2, int booksize) {
  
!   if( buf_overflow(buf1,buf2,BOOK_BUF) 
       || buf_overflow(buf1,buf2,booksize))
  	return 1;
    return 0;
  }
   
--- 780,790 ----
    return retbuf;
  }
   
  int book_overflow(char *buf1, char *buf2, int booksize) {
  
!   if( buf_overflow(buf1,buf2,BOOK_BUF-2) /* 2 less so always room for trailing \n */ 
       || buf_overflow(buf1,buf2,booksize))
  	return 1;
    return 0;
  }