components/prboom/d_deh.c
//========================================================================
// haleyjd 9/22/99
//
// deh_procHelperThing
//
// Allows handy substitution of any thing for helper dogs.  DEH patches
// are being made frequently for this purpose and it requires a complete
// rewiring of the DOG thing.  I feel this is a waste of effort, and so
// have added this new [HELPER] BEX block


Allows handy substitution of any thing for helper dogs.  DEH patches
are being made frequently for this purpose and it requires a complete
rewiring of the DOG thing.  I feel this is a waste of effort, and so
have added this new [HELPER] BEX block
Allows handy substitution of any thing for helper dogs . DEH patches are being made frequently for this purpose and it requires a complete rewiring of the DOG thing . I feel this is a waste of effort and so have added this new [ HELPER ] BEX block
static void deh_procHelperThing(DEHFILE *fpin, FILE *fpout, char *line)
{
  char key[DEH_MAXKEYLEN];
  char inbuffer[DEH_BUFFERMAX];
  uint_64_t value;      
  strncpy(inbuffer,line,DEH_BUFFERMAX);
  while (!dehfeof(fpin) && *inbuffer && (*inbuffer != ' '))
  {
      if (!dehfgets(inbuffer, sizeof(inbuffer), fpin)) break;
      lfstrip(inbuffer);
      if (!*inbuffer) break;    
      if (!deh_GetData(inbuffer,key,&value,NULL,fpout)) 
      {
          if (fpout) fprintf(fpout,"Bad data pair in '%s'\n",inbuffer);
          continue;
      }
      if (fpout)
      {
        fprintf(fpout,"Processing Helper Thing item '%s'\n", key);
        fprintf(fpout,"value is %i", (int)value);
      }
      if (!strncasecmp(key, "type", 4))
        HelperThing = (int)value;
  }
  return;
}
static void deh_procHelperThing ( DEHFILE * fpin , FILE * fpout , char * line ) { char key [ DEH_MAXKEYLEN ] ; char inbuffer [ DEH_BUFFERMAX ] ; uint_64_t value ; strncpy ( inbuffer , line , DEH_BUFFERMAX ) ; while ( ! dehfeof ( fpin ) && * inbuffer && ( * inbuffer != ' ' ) ) { if ( ! dehfgets ( inbuffer , sizeof ( inbuffer ) , fpin ) ) break ; lfstrip ( inbuffer ) ; if ( ! * inbuffer ) break ; if ( ! deh_GetData ( inbuffer , key , & value , NULL , fpout ) ) { if ( fpout ) fprintf ( fpout , " \n " , inbuffer ) ; continue ; } if ( fpout ) { fprintf ( fpout , " \n " , key ) ; fprintf ( fpout , " " , ( int ) value ) ; } if ( ! strncasecmp ( key , " " , 4 ) ) HelperThing = ( int ) value ; } return ; }
haleyjd 9/22/99
deh_procHelperThing
haleyjd 9 / 22 / 99 deh_procHelperThing
// All deh values are ints or longs // returns TRUE if ok // Otherwise it's ok