[CF-Devel] gdb tracing of attack_mode bug:

Jan Echternach echter at informatik.uni-rostock.de
Sun Nov 26 11:30:39 CST 2000


On Fri, Nov 24, 2000 at 11:07:21AM -0800, Peter Mardahl wrote:
>
     
      (gdb) p **hitter
     
     [electric dragon]

>
     
      $16 = {contr = 0x0, next = 0x89df5f0, prev = 0x8c16688, active_next = 0x0, 
     
     >
     
        active_prev = 0x0, below = 0x0, above = 0x0, inv = 0x0, container = 0x0, 
     
     >
     
        env = 0x0, more = 0x0, head = 0x0, map = 0x897e000, count = 0, refcount = 0, 
     
     >
     
        sk_list = 0x0, name = 0x0, title = 0x0, race = 0x0, slaying = 0x0, 
     
     >
     
        msg = 0x0, x = 9, y = 2, ox = 9, oy = 2, speed = 0, 
     
     >
     
        speed_left = -0.100000024, nrof = 0, face = 0x8154050, direction = 0 '\000', 
     
     >
     
        facing = 0 '\000', type = 88 'X', immune = 0, protected = 0, 
     
                            ^^^^^^^^^ CONE object
>
     
        attacktype = 16384, vulnerable = 0, path_attuned = 0, path_repelled = 0, 
     
         ^^^^^^^^^^^^^^^^^^ fear spell?

Looks like the dragon decided to attack an already freed fear cone.

I noticed a small problem in get_enemy():  The

  return npc->enemy = npc->owner->enemy;

should be changed to

  npc->enemy = npc->owner->enemy;

in order to verify that the owner has still a valid enemy.

Nothing new apart from that.  server/monster.c needs a review for
missing was_destroyed() checks.  Maybe an "enemy_count" should be added
to the object structure.  Monsters are casting spells and doing a lot
of other things and are expecting that the enemy still exists after
that.

-- 
Jan

    
    


More information about the crossfire mailing list