Zone reset problem with same EQ pos.

From: Scott Meisenholder (scmeis1@HOTMAIL.COM)
Date: 04/14/03


This is my code to check and see if a mob has loaded eq in a certain
WEAR_POS based on previous load. IF load does not happen i want to read
ahead to next line and check eq pos. too see if it is same wear pos. IF
this is true return true and change the last_cmd from 0 to 1 so the code
thinks this load happened. Just trying to get rid of nasty no mob load
spam in syslog. Obviously my code does not work but Was wondering what was
wrong with my logic. I am very tired from long hours at work, i hope i did
not do something stupid. I am very good at overlooking the obvious. Thanks
all!




int obj_wear_pos(zone_rnum zone, int val)
{
  int cmd_no;

  for (cmd_no= 0; ZCMD.command == 'E'; cmd_no++)
  {
   if (ZCMD.arg3 == val)
     return TRUE;
   else
     return FALSE;
  }
  return FALSE;
}

Inside reset_zone()

    case 'E':   /* object to equipment list */
      if (!mob) {
 ZONE_ERROR("trying to equip non-existant mob, command disabled");
 ZCMD.command = '*';
 break;
      }

      if ((obj_index[ZCMD.arg1].number < ZCMD.arg2) &&
          (rand_number(1, 100) >= ZCMD.arg4)) {

 if (ZCMD.arg3 < 0 || ZCMD.arg3 >= NUM_WEARS) {
   ZONE_ERROR("invalid equipment pos number");
 } else {
   obj = read_object(ZCMD.arg1, REAL);

          IN_ROOM(obj) = NOWHERE;
          load_otrigger(obj);
          if (wear_otrigger(obj, mob, ZCMD.arg3))
     equip_char(mob, obj, ZCMD.arg3);
          else
            obj_to_char(obj, mob);
          tobj = obj;
   last_cmd = 1;
 }
      } else
       if (obj_wear_pos(zone, ZCMD.arg3))
       {
        last_cmd = 1;
        tmob = NULL;
        break;
       }
      else
 last_cmd = 0;
        tmob = NULL;
      break;

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/26/03 PDT