Changeset 1428
- Timestamp:
- 06/04/09 21:57:14 (15 months ago)
- Location:
- trunk/src
- Files:
-
- 2 modified
-
cmd-obj.c (modified) (3 diffs)
-
game-cmd.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cmd-obj.c
r1426 r1428 321 321 int item = args[0].item; 322 322 object_type *o_ptr = object_from_item_idx(item); 323 int amt = args[1].number; 324 325 if (!item_is_available(item, NULL, USE_INVEN | USE_EQUIP)) 326 { 327 msg_print("You do not have that item to drop it."); 328 return; 329 } 330 331 /* Hack -- Cannot remove cursed items */ 332 if ((item >= INVEN_WIELD) && cursed_p(o_ptr)) 333 { 334 msg_print("Hmmm, it seems to be cursed."); 335 return; 336 } 337 338 inven_drop(item, amt); 339 p_ptr->energy_use = 50; 340 } 341 342 static void obj_drop(object_type *o_ptr, int item) 343 { 323 344 int amt; 324 345 … … 326 347 if (amt <= 0) return; 327 348 328 /* Hack -- Cannot remove cursed items */ 329 if ((item >= INVEN_WIELD) && cursed_p(o_ptr)) 330 { 331 msg_print("Hmmm, it seems to be cursed."); 332 return; 333 } 334 335 inven_drop(item, amt); 336 p_ptr->energy_use = 50; 349 cmd_insert(CMD_DROP, item, amt); 337 350 } 338 351 … … 698 711 obj_can_wear, (USE_INVEN | USE_FLOOR), NULL }, 699 712 700 { NULL, CMD_DROP, "drop",713 { obj_drop, CMD_NULL, "drop", 701 714 "Drop which item? ", "You have nothing to drop.", 702 715 NULL, (USE_EQUIP | USE_INVEN), NULL }, -
trunk/src/game-cmd.c
r1419 r1428 157 157 case CMD_WIELD: 158 158 case CMD_TAKEOFF: 159 case CMD_DROP:160 159 case CMD_REFILL: 161 160 case CMD_STUDY_BOOK: … … 196 195 } 197 196 198 /* This takes an item number and a number of those items to destroy. */ 197 /* These take an item number and a number of those items to process. */ 198 case CMD_DROP: 199 199 case CMD_DESTROY: 200 200 { 201 /* TODO: Number should probably be replaced by 'repeat'ing */ 201 202 cmd.args[0].item = va_arg(vp, int); 202 203 cmd.args[1].number = va_arg(vp, int);
