[CODE][NEWBIE] ranged2_1.patch and object_list

From: Mundi King (kingmundi@YAHOO.COM)
Date: 06/28/98


it seems the grenade functions in ranged2_1.patch
is not working correctly, so i fired up the borland
debugger, it is much more sensitive then the msvc
version

the mud (version 30bpl12) boots up fine and loads all
the database files, then sits and waits for a connection,
as soon as i try to log on and put in a character name,
the mud crashes

Fault: access violation 0x425242:
read of address 0xffffffff

the debugger then points to the bottom line of this code
as the offending code,
in fight.c

 void tick_grenade(void)
 {
   struct obj_data *i, *tobj;
   struct char_data *tch, *next_tch;
   int s, t, dam, door;
   /* grenades are activated by pulling the pin - ie, setting the
      one of the extra flag bits. After the pin is pulled the grenade
      starts counting down. once it reaches zero, it explodes. */

   for (i = object_list; i; i = i->next) {

     if (IS_SET(GET_OBJ_EXTRA(i), ITEM_LIVE_GRENADE)) {

^^^ this last line is the offender
so i did an inspection of the variable i

@Register (EDI) :: 000070E0
item_number             18805   (0x4975)
in_room                         1822    (0x071E)

some additional information

in comm.c

if (!(pulse % PULSE_MOBILE))
  {
    mobile_activity();
    tick_grenade();
        }


and in structs.h

#define ITEM_NOSELL        (1 << 16)    /* Shopkeepers won't touch it   */
#define ITEM_LIVE_GRENADE  (1 << 17)    /* grenade's pin has been
pulled */


the answer to the error eludes me,
my question is;
is this variable
        for (i = object_list; i; i = i->next) {

a listing of objects that are in the game?
lying on the floor and in peoples inventory?







_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


     +------------------------------------------------------------+
     | 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