[CF-Devel] Arrow, thrown object and generic attack fixes

Michael Toennies mtx93 at informatik.uni-bremen.de
Tue Oct 31 15:44:35 CST 2000


>
     
      -----Original Message-----
     
     >
     
      From: 
      
      crossfire-devel-admin at lists.real-time.com
      
      
     >
     
      [mailto:
      
      crossfire-devel-admin at lists.real-time.com
      
      ]On Behalf Of Jan
     
     >
     
      Echternach
     
     >
     
      Sent: Tuesday, October 31, 2000 10:37 PM
     
     >
     
      To: 
      
      crossfire-devel at lists.real-time.com
      
      
     >
     
      Subject: [CF-Devel] Arrow, thrown object and generic attack fixes
     
     >
     
     
     >
     
     
     >
     
      Hi,
     
     >
     
     
     >
     
      I started working on a proper fix for the arrow/thrown object problem:
     
     >
     
      Flying items couldn't be picked up, and save_throw_object() did nasty
     
     >
     
      things like putting active cone objects into ice cubes.  There are only
     
     >
     
      workarounds implemented for this problem right now.
     
     >
     
     
     >
     
      The real solution in this patch is the new stop_item() function that
     
     >
     
      stops arrows and thrown objects or tells the caller that cones can't be
     
     >
     
      stopped.  It is used in pick_up_object() and save_throw_object().
     
     >
     
     
     >
     
      While I was working at this problem, I rewrote the arrow handling in
     
     >
     
      server/time.c and noticed a bug there:  Arrows attacked while they were
     
     >
     
      in the process of being moved, and not on any map.  This could cause
     
     >
     
      server crashes when attacking a door with a rune.
     
     >
     
     
     >
     
      Then I noticed that this is a very general problem:  Many things attack
     
     >
     
      while being removed, and only some code could handle this.  So I
     
     >
     
      changed attack_ob() and hit_player() to insist on that either both
     
     >
     
      attacker and victim are on the same map, or that one is in the other's
     
     >
     
      inventory.  The latter case is a "simple" attack that skips most parts
     
     >
     
      of attack_ob() and some parts of hit_player().
     
     
When i understand, you can't now step on stairs, move up, fire some
fireballs/bombs/
arrows and step down, waiting for the damage?
Thats a nice trick to play and remove it will make some maps much harder.

>
     
      Now I had to change many move_<spell>() functions because most of them
     
     >
     
      did attack with removed attackers.  I found other possible server
     
     >
     
      crashes here:  move_fired_arch() already had an ugly workaround for
     
     >
     
      some server crashes (it removed AT_GHOSTHIT before attacking, because
     
     >
     
      this would lead to removing an removed object in hit_player()), but
     
     >
     
      this workaround was broken with the advent of FLAG_ONE_HIT.  And
     
     >
     
      check_fired_arch() didn't have such a workaround in the first place,
     
     >
     
      even though it had the same problem.
     
     >
     
     
     >
     
      The result is the attached patch.  It probably needs some more testing
     
     >
     
      as it touches many basic parts of crossfire, but it already looks very
     
     >
     
      promising (i.e. no new server crashes on the MwizardG map ;-).  Please
     
     >
     
      tell me if you have any comments on it.  I'd like to apply this patch
     
     >
     
      to the CVS tree once it got a bit more testing.
     
     >
     
     
     >
     
      --
     
     >
     
      Jan
     
     >
     
     
     
    


More information about the crossfire mailing list