[CF-Devel] Re: [Crossfire-cvs] CVS commit: crossfire

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Wed Jan 5 01:57:02 CST 2005


Andreas Kirschbaum wrote:
>
     
      Salathar wrote:
     
     >
     
     
     >>
     
     There probably was or still is a reson for pl != NULL checks, maybe
     
     >>
     
     the code should be something like:
     
     >>
     
     
     >>
     
          if (pl!=NULL && draw_exit) {
     
     >>
     
            if !(QUERY_FLAG(pl->ob,FLAG_WIZ) && pl->ob->contr->hidden)
     
     >>
     
                    new_draw_info(NDI_UNIQUE | NDI_ALL | NDI_DK_ORANGE, 5,
     
     >>
     
     NULL, buf);
     
     >>
     
          }
     
     >
     
     
     >
     
     
     >
     
      I'd rather merge this statement into the previous if(pl!=NULL) block:
     
     >
     
     
     >
     
          if (pl!=NULL) {
     
     >
     
     
     >
     
              [...]
     
     >
     
     
     >
     
              if (draw_exit) {
     
     >
     
                  if (!QUERY_FLAG(pl->ob, FLAG_WIZ) || !pl->ob->contr->hidden) {
     
     >
     
                      new_draw_info(NDI_UNIQUE|NDI_ALL|NDI_DK_ORANGE, 5, NULL, buf);
     
     >
     
                  }
     
     >
     
              }
     
     >
     
          }
     
     
  Yes - that makes more sense.

  Whether to have two if statements is more an issue of styl - I don't see any 
reason that couldn't just be one if statement, since the code isn't doing 
anything else if draw_exit is set.


_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list