[CF-Devel] patch for generators to create special ability mo

Norbert Irmer norbert.irmer at t-online.de
Wed Apr 17 10:58:48 CDT 2002


Oh, sorry. I forgot the patch to 'server/attack.c', which destroys the 
objects in the
inventory of a generator, when the generator gets destroyed.

-------------- next part --------------
Index: attack.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/server/attack.c,v
retrieving revision 1.66
diff -c -5 -r1.66 attack.c
*** attack.c	11 Mar 2002 22:02:37 -0000	1.66
--- attack.c	17 Apr 2002 15:50:14 -0000
***************
*** 1244,1254 ****
      char buf[MAX_BUF];
      object *old_hitter=NULL; /* this is used in case of servant monsters */
      int maxdam=0;
      int battleg=0;    /* true if op standing on battleground */
      int killed_script_rtn = 0;
!     object *owner=NULL;
      int evtid;
  #ifdef PLUGINS
      CFParm CFP;
  #endif
      /* Object has been killed.  Lets clean it up */
--- 1244,1254 ----
      char buf[MAX_BUF];
      object *old_hitter=NULL; /* this is used in case of servant monsters */
      int maxdam=0;
      int battleg=0;    /* true if op standing on battleground */
      int killed_script_rtn = 0;
!     object *owner=NULL,*tmp;
      int evtid;
  #ifdef PLUGINS
      CFParm CFP;
  #endif
      /* Object has been killed.  Lets clean it up */
***************
*** 1447,1456 ****
--- 1447,1463 ----
  		    play_sound_player_only(owner->contr, SOUND_PET_IS_KILLED,0,0);
  		    new_draw_info(NDI_UNIQUE, 0,owner,buf);
  		}
                  remove_friendly_object(op);
  	    }
+             if(QUERY_FLAG(op,FLAG_GENERATOR)) {
+ 	      while (op->inv) { /* destroy the inventory of generators */
+                 tmp = op->inv;
+                 remove_ob(tmp);
+                 free_object(tmp) ;
+               }
+             }
  	    remove_ob(op);
  	    free_object(op);
  	}
  	/* Player has been killed! */
  	else {
    
    


More information about the crossfire mailing list