Difference for server/apply.c from version 1.84 to 1.85


version 1.84 version 1.85
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_apply_c =   * static char *rcsid_apply_c =
  *   "$Id: apply.c,v 1.84 2003/06/26 11:27:43 gros Exp $";   *   "$Id: apply.c,v 1.85 2003/09/03 12:25:06 tchize Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 3151
 
Line 3151
   
   switch(op->type) {    switch(op->type) {
   case SHOP_FLOOR:    case SHOP_FLOOR:
     if (op->randomitems==NULL) return 0;      if (!HAS_RANDOM_ITEMS(op)) return 0;
     do {      do {
       i=10; /* let's give it 10 tries */        i=10; /* let's give it 10 tries */
       while((tmp=generate_treasure(op->randomitems,        while((tmp=generate_treasure(op->randomitems,
Line 3173
 
Line 3173
     break;      break;
   
   case TREASURE:    case TREASURE:
       if (QUERY_FLAG(op,FLAG_IS_A_TEMPLATE))
           return 0;
     while ((op->stats.hp--)>0)      while ((op->stats.hp--)>0)
       create_treasure(op->randomitems, op, op->map?GT_ENVIRONMENT:0,        create_treasure(op->randomitems, op, op->map?GT_ENVIRONMENT:0,
  op->stats.exp ? op->stats.exp :    op->stats.exp ? op->stats.exp :
Line 3220
 
Line 3222
  invnext = invtmp->below;   invnext = invtmp->below;
  if(QUERY_FLAG(invtmp,FLAG_AUTO_APPLY))   if(QUERY_FLAG(invtmp,FLAG_AUTO_APPLY))
      auto_apply(invtmp);       auto_apply(invtmp);
  else if(invtmp->type==TREASURE) {              else if(invtmp->type==TREASURE && HAS_RANDOM_ITEMS(invtmp)) {
      while ((invtmp->stats.hp--)>0)       while ((invtmp->stats.hp--)>0)
  create_treasure(invtmp->randomitems, invtmp, 0,   create_treasure(invtmp->randomitems, invtmp, 0,
                             m->difficulty,0);                              m->difficulty,0);
Line 3230
 
Line 3232
   
  if(QUERY_FLAG(tmp,FLAG_AUTO_APPLY))   if(QUERY_FLAG(tmp,FLAG_AUTO_APPLY))
           auto_apply(tmp);            auto_apply(tmp);
         else if((tmp->type==TREASURE || (tmp->type==CONTAINER))&&tmp->randomitems) {          else if((tmp->type==TREASURE || (tmp->type==CONTAINER))&&HAS_RANDOM_ITEMS(tmp)) {
    while ((tmp->stats.hp--)>0)     while ((tmp->stats.hp--)>0)
             create_treasure(tmp->randomitems, tmp, 0,              create_treasure(tmp->randomitems, tmp, 0,
                             m->difficulty,0);                              m->difficulty,0);
Line 3239
 
Line 3241
    tmp->speed = 0;     tmp->speed = 0;
    update_ob_speed(tmp);     update_ob_speed(tmp);
  }   }
         else if(tmp && tmp->arch && tmp->type!=PLAYER && tmp->type!=TREASURE &&          else if(tmp && tmp->arch && tmp->type!=PLAYER && tmp->type!=TREASURE && HAS_RANDOM_ITEMS(tmp))
    tmp->randomitems)  
             create_treasure(tmp->randomitems, tmp, GT_APPLY,              create_treasure(tmp->randomitems, tmp, GT_APPLY,
                             m->difficulty,0);                              m->difficulty,0);
       }        }
     /*end of cycle through map square*/
   for(x=0;x<MAP_WIDTH(m);x++)    for(x=0;x<MAP_WIDTH(m);x++)
     for(y=0;y<MAP_HEIGHT(m);y++)      for(y=0;y<MAP_HEIGHT(m);y++)
       for(tmp=get_map_ob(m,x,y);tmp!=NULL;tmp=tmp->above)        for(tmp=get_map_ob(m,x,y);tmp!=NULL;tmp=tmp->above)


Legend:
line(s) removed in v.1.84 
line(s) changed
 line(s) added in v.1.85

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:23