Re: strange thing in read_mobile()...

From: George Greer (greerga@circlemud.org)
Date: 11/13/01


On Tue, 13 Nov 2001, The Arrow wrote:

>In the function read_mobile() (db.c), we have a couple of lines that read:
>
>  if (!mob->points.max_hit)
>  {
>      mob->points.max_hit = dice(mob->points.hit, mob->points.mana) +
>          mob->points.move;
>  }
>  else
>      mob->points.max_hit = number(mob->points.hit, mob->points.mana);
>
>
>Shouldn't the if statement check mob->points.move? And if it should, why
>bother?  :)  Just adding 0 is both faster, and looks a little bit better
>(I think).

db.c: parse_mobile says:

  /* max hit = 0 is a flag that H, M, V is xdy+z */
  GET_MAX_HIT(mob_proto + i) = 0;
  GET_HIT(mob_proto + i) = t[3];
  GET_MANA(mob_proto + i) = t[4];
  GET_MOVE(mob_proto + i) = t[5];

My lex/yacc parser says:

  /* Flag to denote maximum hit points being "H d M + V". */
  mob->points.max_hit = 0;

(Also note the difference in 'dice' and 'number' being called in
read_mobile.)

--
George Greer
greerga@circlemud.org

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST