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

CF: patch for Improvement scroll



This is a report from Japanese crossfire maling-list.

If character use improvement scroll without mark to item
(use mark command), the game is crash. Because NON-mark
code doesn't exist in program.
We refer to torch code to make this patch.

patch for server/apply.c

*** apply.c	Mon Sep 30 14:53:55 1996
--- apply.c.new	Thu Oct  3 09:24:39 1996
***************
*** 769,785 ****
  	}
      }
  #endif
!     if (otmp->type!=WEAPON) {
!       new_draw_info(NDI_UNIQUE, 0,op,"Marked item is not a weapon");
!       return 0;
!     }
!     new_draw_info(NDI_UNIQUE, 0,op,"Applied weapon builder.");
!     improve_weapon(op,tmp,otmp);
!     if (op->contr->eric_server > 0)
!       esrv_send_item(op, tmp);
!     else
!       draw_inventory(op);
!     return 1;
  }
  
  /* archetypes don't contain any MONEY_CHANGER object,
--- 769,788 ----
  	}
      }
  #endif
!     if (otmp) {
!         if (otmp->type!=WEAPON) {
!           new_draw_info(NDI_UNIQUE, 0,op,"Marked item is not a weapon");
!           return 0;
!         }
!         new_draw_info(NDI_UNIQUE, 0,op,"Applied weapon builder.");
!         improve_weapon(op,tmp,otmp);
!         if (op->contr->eric_server > 0)
!           esrv_send_item(op, tmp);
!         else
!           draw_inventory(op);
!         return 1;
!     } else
!         new_draw_info(NDI_UNIQUE, 0,op,"You need to mark a weapon.");
  }
  
  /* archetypes don't contain any MONEY_CHANGER object,
***************
*** 1944,1966 ****
  	||op->inv->type==BRACERS || op->inv->type==SHIELD
  	||op->inv->type==HELMET)
  #endif
!     if (armor->type==ARMOUR
! 	|| armor->type==CLOAK
! 	|| armor->type==BOOTS || armor->type==GLOVES
! 	||armor->type==BRACERS || armor->type==SHIELD
! 	||armor->type==HELMET)
!     {
      	    new_draw_info(NDI_UNIQUE, 0,op,"Applying armour enchantment.");
      	    improve_armour(op,tmp,armor);
!    	     if (op->contr->eric_server > 0)
!       			esrv_send_item(op, tmp);
      	     else
!       			draw_inventory(op);
  
      	     return 1;
!     } 
  
      new_draw_info(NDI_UNIQUE, 0,op,"Your marked item is not armour!\n");
      return 0;
     }
  
--- 1947,1973 ----
  	||op->inv->type==BRACERS || op->inv->type==SHIELD
  	||op->inv->type==HELMET)
  #endif
!     if (armor) {
!         if (armor->type==ARMOUR
!     	|| armor->type==CLOAK
!     	|| armor->type==BOOTS || armor->type==GLOVES
!     	||armor->type==BRACERS || armor->type==SHIELD
!     	||armor->type==HELMET)
!         {
      	    new_draw_info(NDI_UNIQUE, 0,op,"Applying armour enchantment.");
      	    improve_armour(op,tmp,armor);
!     	    if (op->contr->eric_server > 0)
!     			esrv_send_item(op, tmp);
      	     else
!     			draw_inventory(op);
  
      	     return 1;
!         } 
  
      new_draw_info(NDI_UNIQUE, 0,op,"Your marked item is not armour!\n");
+     } else
+         new_draw_info(NDI_UNIQUE, 0,op,"You need to mark a armour.");
+ 
      return 0;
     }
  
***************
*** 2496,2501 ****
  	save_throw_object(item,AT_FIRE);
  
     } else /* nothing to light */ 
! 	new_draw_info(NDI_UNIQUE, 0,who,"You need to mark a lightable object");
  
  }
--- 2503,2508 ----
  	save_throw_object(item,AT_FIRE);
  
     } else /* nothing to light */ 
! 	new_draw_info(NDI_UNIQUE, 0,who,"You need to mark a lightable object.");
  
  }

Sorry, my English is poor.
-- 
Mannen Akihiro mannen@is.s.u-tokyo.ac.jp
Department of Information Science, Faculty of Science
University of Tokyo