Difference for server/build_map.c from version 1.5 to 1.6


version 1.5 version 1.6
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_build_map =   * static char *rcsid_build_map =
  *   "$Id: build_map.c,v 1.5 2005/08/16 05:23:13 qal21 Exp $";   *   "$Id: build_map.c,v 1.6 2005/08/17 18:38:34 qal21 Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 32
 
Line 32
 #include <tod.h>  #include <tod.h>
 #include <sproto.h>  #include <sproto.h>
   
 static object* get_connection_rune( object* pl, short x, short y );  
 static object* get_msg_book( object* pl, short x, short y );  
 static int adjust_sign_msg( object* pl, short x, short y, object* tmp );  
   
 /**  /**
  *  Check if objects on a square interfere with building   *  Check if objects on a square interfere with building
  */   */
Line 57
 
Line 53
              if ( ob->type != BOOK ) {               if ( ob->type != BOOK ) {
          return 0; }            return 0; }
                     break;                      break;
    case BUTTON:
            case DETECTOR:
                   case PEDESTAL:
                   case CF_HANDLE:
        /* Allow buttons and levers to be built under gates */
                if ( ob->type != GATE && ob->type != DOOR ) {
            return 0; }
                       break;
                 default:                  default:
                     return 0;                      return 0;
                 }                  }
Line 123
 
Line 127
  * If found, returns the connection value associated   * If found, returns the connection value associated
  * else searches a new connection value, and adds the force to the player.   * else searches a new connection value, and adds the force to the player.
  */   */
 int find_or_create_connection_for_map( object* pl, short x, short y )  int find_or_create_connection_for_map( object* pl, short x, short y, object* rune )
     {      {
     object* rune;  
     object* force;      object* force;
     int connected;      int connected;
   
       if ( !rune )
     rune = get_connection_rune( pl, x, y );      rune = get_connection_rune( pl, x, y );
   
     if ( !rune )      if ( !rune )
Line 171
 
Line 175
 /**  /**
  * Returns the marking rune on the square, for purposes of building connections   * Returns the marking rune on the square, for purposes of building connections
  */   */
 static object* get_connection_rune( object* pl, short x, short y )  object* get_connection_rune( object* pl, short x, short y )
     {      {
     object* rune;      object* rune;
          
Line 184
 
Line 188
 /**  /**
  * Returns the book/scroll on the current square, for purposes of building   * Returns the book/scroll on the current square, for purposes of building
  */   */
 static object* get_msg_book( object* pl, short x, short y )  object* get_msg_book( object* pl, short x, short y )
     {      {
     object* book;      object* book;
          
Line 540
 
Line 544
     struct archt* arch;      struct archt* arch;
     int insert_flag;      int insert_flag;
     object* floor;      object* floor;
       object* con_rune;
     int connected;      int connected;
   
     /* Find floor */      /* Find floor */
Line 594
 
Line 599
  case MAGIC_EAR:   case MAGIC_EAR:
  case SIGN:   case SIGN:
      /* Signs don't need a connection, but but magic mouths do. */       /* Signs don't need a connection, but but magic mouths do. */
      if (get_connection_rune( pl, x, y ) && (tmp->type != SIGN ||        if (tmp->type == SIGN && strcmp( tmp->arch->name, "magic_mouth" ))
      !strcmp( tmp->arch->name, "magic_mouth" )))           break;
          {       con_rune = get_connection_rune( pl, x, y );
                 connected = find_or_create_connection_for_map( pl, x, y );       connected = find_or_create_connection_for_map( pl, x, y, con_rune );
                 if ( connected == -1 )                  if ( connected == -1 )
                     {                      {
                     /* Player already informed of failure by the previous function */                      /* Player already informed of failure by the previous function */
Line 605
 
Line 610
                     return;                      return;
                     }                      }
                 /* Remove marking rune */                  /* Remove marking rune */
                 remove_marking_runes( pl->map, x, y );              remove_ob( con_rune );
  }              free_object( con_rune );
         }          }
    
     /* For magic mouths/ears, and signs, take the msg from a book of scroll */       /* For magic mouths/ears, and signs, take the msg from a book of scroll */
Line 819
 
Line 824
  * For objects already invisible (i.e. magic mouths & ears), also make it   * For objects already invisible (i.e. magic mouths & ears), also make it
  * it inherit the face and the name with "talking " prepended.   * it inherit the face and the name with "talking " prepended.
  */   */
 static int adjust_sign_msg( object* pl, short x, short y, object* tmp )  int adjust_sign_msg( object* pl, short x, short y, object* tmp )
     {      {
     object* book;      object* book;
     char buf[MAX_BUF];      char buf[MAX_BUF];
       char buf2[MAX_BUF];
     int namelen;      int namelen;
   
     book = get_msg_book( pl, x, y );      book = get_msg_book( pl, x, y );
Line 847
 
Line 853
      free_string( tmp->name );       free_string( tmp->name );
  tmp->name = add_string( buf );   tmp->name = add_string( buf );
    
    if(book->name_pl != NULL)
        {
        snprintf(buf2, sizeof(buf2), "talking %s", book->name_pl);
        if ( tmp->name_pl )
                   free_string( tmp->name_pl );
               tmp->name_pl = add_string( buf2 );
        }
   
  tmp->face = book->face;   tmp->face = book->face;
  tmp->invisible = 0;   tmp->invisible = 0;
         }          }


Legend:
line(s) removed in v.1.5 
line(s) changed
 line(s) added in v.1.6

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:26