Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch to fix golem bug.



Here is a patch to fix the golem bug.  Basically it duplicates some of the
code out of hit_map() (or whatever it is called) so that the monster notices
the golem hitting it wherever it happens to hit it.

--JT
----------------------------------cut here---------------------------------
*** spells.c.old	Tue Sep 15 19:37:51 1992
--- spells.c	Tue Sep 15 20:05:08 1992
***************
*** 299,304 ****
--- 299,305 ----
    op->name=add_string("golem");
    return op;
  }
+ 
  void move_golem(object *op) {
    object *tmp;
    if(get_owner(op)==NULL) {
***************
*** 325,336 ****
    if(!move_ob(op,op->direction)) {
      update_object(op);
      hit_map(op,op->direction,AT_PHYSICAL);
!     tmp=get_map_ob(op->map,op->x+DIRX(op),op->y+DIRY(op));
!     while(tmp!=NULL&&
!           (!IS_ALIVE(tmp)||tmp->speed==0||(tmp->stats.wc==0&&tmp->stats.dam==0)))
!       tmp=tmp->above;
!     if(tmp!=NULL)
!       attack_ob(op,tmp);
    }
  }
  
--- 326,336 ----
    if(!move_ob(op,op->direction)) {
      update_object(op);
      hit_map(op,op->direction,AT_PHYSICAL);
!     for (tmp = get_map_ob(op->map, op->x+freearr_x[op->direction],
!                           op->y+freearr_y[op->direction]);
!          tmp != NULL; tmp = tmp->above)
!       if(IS_ALIVE(tmp))
!         attack_ob(op,tmp);
    }
  }
  
----------------------------------cut here---------------------------------
(I tested this code and it does indeed work)
-------------------------------------------------------------------------
Practice random kindness and senseless acts of beauty --Anonymous
Argue for your limitations and sure enough they're yours --Richard Bach

Moonchilde/Amythyst/JT Traub ---           jtraub@cmu.edu