Index: cmd3.c
===================================================================
RCS file: /home/rr9/angband/angband/src/cmd3.c,v
retrieving revision 1.31
diff -u -r1.31 cmd3.c
--- cmd3.c	5 Mar 2005 11:03:22 -0000	1.31
+++ cmd3.c	13 Jun 2006 21:48:01 -0000
@@ -132,11 +132,14 @@
 	object_type *i_ptr;
 	object_type object_type_body;
 
+	object_type *equip_o_ptr;
+
 	cptr act;
 
 	cptr q, s;
 
 	char o_name[80];
+	char out_val[160];
 
 
 	/* Restrict the choices */
@@ -163,11 +166,14 @@
 	/* Check the slot */
 	slot = wield_slot(o_ptr);
 
+	/* Get a pointer to the slot to be removed */
+	equip_o_ptr = &inventory[slot];
+
 	/* Prevent wielding into a cursed slot */
-	if (cursed_p(&inventory[slot]))
+	if (cursed_p(equip_o_ptr))
 	{
 		/* Describe it */
-		object_desc(o_name, sizeof(o_name), &inventory[slot], FALSE, 0);
+		object_desc(o_name, sizeof(o_name), equip_o_ptr, FALSE, 0);
 
 		/* Message */
 		msg_format("The %s you are %s appears to be cursed.",
@@ -177,6 +183,33 @@
 		return;
 	}
 
+	/* Double-check taking off an item with "!t" */
+	if (equip_o_ptr->note)
+	{
+		/* Find a '!' */
+		s = strchr(quark_str(equip_o_ptr->note), '!');
+
+		/* Process preventions */
+		/* XXX Perhaps this should be factored out to a seperate function? */
+		while (s)
+		{
+			/* Check the "restriction" */
+			if (s[1] == 't')
+			{
+				/* Describe it */
+				object_desc(o_name, sizeof(o_name), equip_o_ptr, TRUE, 3);
+
+				/* Prompt */
+				strnfmt(out_val, sizeof(out_val), "Really take off %s? ", o_name);
+
+				/* Forget it */
+				if (!get_check(out_val)) return;
+			}
+
+			/* Find another '!' */
+			s = strchr(s + 1, '!');
+		}
+	}
 
 	/* Take a turn */
 	p_ptr->energy_use = 100;

