Changeset 357
- Timestamp:
- 07/19/07 09:54:22 (1 year ago)
- Files:
-
- branches/angband-3.0.8/src/cmd3.c (modified) (2 diffs)
- branches/angband-3.0.8/src/externs.h (modified) (1 diff)
- branches/angband-3.0.8/src/squelch.c (modified) (2 diffs)
- branches/angband-3.0.8/src/util.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/angband-3.0.8/src/cmd3.c
r291 r357 643 643 o_ptr->note = 0; 644 644 645 /* Combine the pack */646 p_ptr->notice |= (PN_COMBINE );645 /* Combine the pack, check for squelchables */ 646 p_ptr->notice |= (PN_COMBINE | PN_SQUELCH); 647 647 648 648 /* Window stuff */ … … 707 707 o_ptr->note = quark_add(tmp); 708 708 709 /* Combine the pack */710 p_ptr->notice |= (PN_COMBINE );709 /* Combine the pack, check for squelchables */ 710 p_ptr->notice |= (PN_COMBINE | PN_SQUELCH); 711 711 712 712 /* Window stuff */ branches/angband-3.0.8/src/externs.h
r279 r357 635 635 extern errr quarks_init(void); 636 636 extern errr quarks_free(void); 637 extern bool check_for_inscrip(const object_type *o_ptr, const char *inscrip); 637 638 extern s16b message_num(void); 638 639 extern cptr message_str(s16b age); branches/angband-3.0.8/src/squelch.c
r351 r357 329 329 if (artifact_p(o_ptr)) return FALSE; 330 330 331 /* Don't squelch stuff inscribed not to be destroyed (!k) */ 332 if (check_for_inscrip(o_ptr, "!k") || check_for_inscrip(o_ptr, "!*")) 333 { 334 return FALSE; 335 } 336 331 337 /* Auto-squelch dead chests */ 332 338 if (o_ptr->tval == TV_CHEST && o_ptr->pval == 0) … … 523 529 if (!squelch_item_ok(o_ptr)) continue; 524 530 525 /* Drop item */ 526 inven_drop(n, o_ptr->number); 531 /* Check for !d (no drop) inscription */ 532 if (!check_for_inscrip(o_ptr, "!d") && !check_for_inscrip(o_ptr, "!*")) 533 { 534 /* We're allowed to drop it. */ 535 inven_drop(n, o_ptr->number); 536 } 527 537 } 528 538 branches/angband-3.0.8/src/util.c
r350 r357 1490 1490 } 1491 1491 1492 /* 1493 * Looks if "inscrip" is present on the given object. 1494 */ 1495 bool check_for_inscrip(const object_type *o_ptr, const char *inscrip) 1496 { 1497 if (o_ptr->note) 1498 { 1499 const char *s = strstr(quark_str(o_ptr->note), inscrip); 1500 if (s) return TRUE; 1501 } 1502 1503 return FALSE; 1504 } 1492 1505 1493 1506 /* … … 3425 3438 for (i = INVEN_WIELD; i < INVEN_TOTAL; i++) 3426 3439 { 3427 c ptr s;3440 char verify_inscrip[] = "^*"; 3428 3441 3429 3442 object_type *o_ptr = &inventory[i]; … … 3432 3445 if (!o_ptr->k_idx) continue; 3433 3446 3434 /* No inscription */ 3435 if (!o_ptr->note) continue; 3436 3437 /* Find a '^' */ 3438 s = strchr(quark_str(o_ptr->note), '^'); 3439 3440 /* Process preventions */ 3441 while (s) 3442 { 3443 /* Check the "restriction" character */ 3444 if ((s[1] == p_ptr->command_cmd) || (s[1] == '*')) 3447 /* Set up string to look for, e.g. "^d" */ 3448 verify_inscrip[1] = p_ptr->command_cmd; 3449 3450 if (check_for_inscrip(o_ptr, "^*") || check_for_inscrip(o_ptr, verify_inscrip)) 3451 { 3452 /* Hack -- Verify command */ 3453 if (!get_check("Are you sure? ")) 3445 3454 { 3446 /* Hack -- Verify command */ 3447 if (!get_check("Are you sure? ")) 3448 { 3449 /* Hack -- Use "newline" */ 3450 p_ptr->command_cmd = '\n'; 3451 } 3455 /* Hack -- Use "newline" */ 3456 p_ptr->command_cmd = '\n'; 3452 3457 } 3453 3454 /* Find another '^' */3455 s = strchr(s + 1, '^');3456 3458 } 3457 3459 }
