Re: hmmm.... db.c:free_char()&ob-weather

From: Angus Mezick (angus@EDGIL.CCMAIL.COMPUSERVE.COM)
Date: 08/06/98


DOH!  gawd I should have thought a little harder about what i was trying to
accomplish.  Sigh.
--Angus
obcircle - here is a little something for the weather discussion:
These should help get you started.  Essentially, embed the weather structures in
a zone, define the # of seasons in the zone,  Set each of wind (calm-tornado)/
wind_dir/ wind_vaiance/ precip (arid-continual)/ temp(freezing - Boiling)
general season trends, and work up a way to change the seasons.  G'Luck.

struct climate {
  char season_pattern;
  char season_wind[MAX_SEASONS];
  char season_wind_dir[MAX_SEASONS];
  char season_wind_variance[MAX_SEASONS];
  char season_precip[MAX_SEASONS];
  char season_temp[MAX_SEASONS];
  char flags;
  signed int energy_add;
};

struct weather_data {
  int free_energy;
  int pressure;                 /* Kept from previous system */
  int windspeed;
  char ambient_light;           /* Interaction between sun, moon, clouds, etc.
Local lights ignored */
  char flags;
  char precip_depth;            /* Snowpack, flood level */
  char pressure_change, precip_change;
  char wind_dir;
  signed char humidity;
  signed char precip_rate;
  signed char temp;             /* In Celsius... So what if I'm a yankee, I
still prefer the metric system */
};

struct zone_data {
  char *name;                   /* name of this zone                  */
  int lifespan;                 /* current (minutes) in this reset */
  int age;                      /* current age of this zone (minutes) */
  int top;                      /* upper limit for rooms in this zone */
  ubyte flags;

  int real_top, real_bottom;
  int reset_mode;
  /*
   *  Reset mode:                              *
   *  0: Don't reset, and don't update age.    *
   *  1: Reset if no PC's are located in zone. *
   *  2: Just reset.                           *
   */

  struct reset_com *cmd;        /* command table for reset              */

  struct climate climate;
  struct weather_data conditions;
};


______________________________ Reply Separator _________________________________
Subject: Re:  hmmm.... db.c:free_char()
Author:  INTERNET:CIRCLE@POST.QUEENSU.CA at CSERVE
Date:    8/6/98 11:22 AM


On Thu, 6 Aug 1998, Angus Mezick wrote:

>At the very end of this function, is there any reason not to do a ch=NULL;
>right have the free(ch); call?  I think this might be a nice way to ensure
>consistancy.  But for that DT and fast aggr problem, you need to check to
>see if(ch && ch->in_room)

Won't do anything, the pointer's value is passed, not the actual pointer.

If you really wanted to, you'd have to make it a struct char_data **ch in
that function instead, then free_char(&ch), and fix the function
accordingly.

--
George Greer, greerga@circlemud.org


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST