fix issue #1580 - item action for leash in use

Issue reported by JodiJodington:  the item action for a leash didn't
distringuish a leash that is already in use from one that isn't.

Fixes 1580
This commit is contained in:
PatR
2026-06-12 01:11:43 -07:00
parent 6c11cac0f7
commit dfd6e0739f
2 changed files with 12 additions and 3 deletions
+1
View File
@@ -60,6 +60,7 @@ monsters (including pets) aren't scared of the Sokoban rolling boulder traps
fix a bug in which steeds would continuously gain movement points while
being ridden
when hero's behavior makes erinyes stronger, cap level at 49 rather than 50
with inventory item action for leash, distingluish leash-in-use from empty one
Platform- and/or Interface-Specific Fixes
+11 -3
View File
@@ -331,9 +331,17 @@ itemactions(struct obj *otmp)
ia_addmenu(win, IA_APPLY_OBJ, 'a', "Use this tool to pick a lock");
else if (otmp->otyp == TINNING_KIT)
ia_addmenu(win, IA_APPLY_OBJ, 'a', "Use this kit to tin a corpse");
else if (otmp->otyp == LEASH)
ia_addmenu(win, IA_APPLY_OBJ, 'a', "Tie a pet to this leash");
else if (otmp->otyp == SADDLE)
else if (otmp->otyp == LEASH) {
if (!otmp->leashmon) {
Strcpy(buf, "Attach this leash to a pet");
} else {
mtmp = find_mid(otmp->leashmon, FM_FMON);
if (!mtmp) /* assume this won't happen */
panic("Can't find leash's monster");
Sprintf(buf, "Detach this leash from %s", some_mon_nam(mtmp));
}
ia_addmenu(win, IA_APPLY_OBJ, 'a', buf);
} else if (otmp->otyp == SADDLE)
ia_addmenu(win, IA_APPLY_OBJ, 'a', "Place this saddle on a pet");
else if (otmp->otyp == MAGIC_WHISTLE
|| otmp->otyp == TIN_WHISTLE)