Changeset 1429
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cmd-obj.c
r1428 r1429 201 201 object_type *o_ptr = object_from_item_idx(args[0].item); 202 202 203 if (obj_has_inscrip(o_ptr)) 204 msg_print("Inscription removed."); 205 203 206 o_ptr->note = 0; 204 msg_print("Inscription removed.");205 207 206 208 p_ptr->notice |= (PN_COMBINE | PN_SQUELCH); … … 265 267 int item = args[0].item; 266 268 269 if (!item_is_available(item, NULL, USE_EQUIP)) 270 { 271 msg_print("You are not wielding that item."); 272 return; 273 } 274 275 if (!obj_can_takeoff(object_from_item_idx(item))) 276 { 277 msg_print("You cannot take off that item."); 278 return; 279 } 280 267 281 (void)inven_takeoff(item, 255); 268 282 p_ptr->energy_use = 50; … … 280 294 281 295 int item = args[0].item; 282 283 296 object_type *o_ptr = object_from_item_idx(item); 297 298 if (!item_is_available(item, NULL, USE_INVEN | USE_FLOOR)) 299 { 300 msg_print("You do not have that item to wield."); 301 return; 302 } 284 303 285 304 /* Check the slot */ … … 622 641 } 623 642 643 624 644 /*** Refuelling ***/ 625 626 static bool obj_refill_pre(void) 627 { 628 object_type *o_ptr; 645 void do_cmd_refill(cmd_code code, cmd_arg args[]) 646 { 647 object_type *j_ptr = &inventory[INVEN_LITE]; 629 648 u32b f[OBJ_FLAG_N]; 630 649 631 o_ptr = &inventory[INVEN_LITE];632 object_flags(o_ptr, f);633 634 if (o_ptr->tval != TV_LITE)635 {636 msg_print("You are not wielding a light.");637 return FALSE;638 }639 640 else if (f[2] & TR2_NO_FUEL)641 {642 msg_print("Your light cannot be refilled.");643 return FALSE;644 }645 646 return TRUE;647 }648 649 void do_cmd_refill(cmd_code code, cmd_arg args[])650 {651 object_type *j_ptr = &inventory[INVEN_LITE];652 650 int item = args[0].item; 653 651 object_type *o_ptr = object_from_item_idx(item); 654 p_ptr->energy_use = 50; 652 653 if (!item_is_available(item, NULL, USE_INVEN | USE_FLOOR)) 654 { 655 msg_print("You do not have that item to refill with it."); 656 return; 657 } 658 659 /* Check what we're wielding. */ 660 object_flags(j_ptr, f); 661 662 if (j_ptr->tval != TV_LITE) 663 { 664 msg_print("You are not wielding a light."); 665 return; 666 } 667 668 else if (f[2] & TR2_NO_FUEL) 669 { 670 msg_print("Your light cannot be refilled."); 671 return; 672 } 655 673 656 674 /* It's a lamp */ … … 662 680 refuel_torch(j_ptr, o_ptr, item); 663 681 682 p_ptr->energy_use = 50; 664 683 } 665 684 … … 759 778 { NULL, CMD_REFILL, "refill", 760 779 "Refuel with what fuel source? ", "You have nothing to refuel with.", 761 obj_can_refill, (USE_INVEN | USE_FLOOR), obj_refill_pre},780 obj_can_refill, (USE_INVEN | USE_FLOOR), NULL }, 762 781 }; 763 782 -
trunk/src/cmd3.c
r1417 r1429 216 216 { 217 217 squelch_items(); 218 return; 219 } 220 221 if (!item_is_available(item, NULL, USE_INVEN | USE_EQUIP | USE_FLOOR)) 222 { 223 msg_print("You do not have that item to destroy it."); 218 224 return; 219 225 }
