Fix funny message: can't give to dead pcs because 'no item slot'

This commit is contained in:
2025-04-06 18:04:52 -05:00
parent 3af79e80d3
commit 8b14519fa5
4 changed files with 9 additions and 2 deletions

View File

@@ -334,6 +334,9 @@ void handle_sale(int i) {
else if(base_item.variety == eItemType::QUEST) ASB("You already completed this."); else if(base_item.variety == eItemType::QUEST) ASB("You already completed this.");
else ASB("You own too many of this."); else ASB("You own too many of this.");
break; break;
// This should not happen:
case eBuyStatus::DEAD:
break;
} }
break; break;
case eShopItemType::ALCHEMY: case eShopItemType::ALCHEMY:

View File

@@ -967,6 +967,10 @@ short select_pc(eSelectPC mode, std::string title, eSkill highlight_highest, boo
extra_info = "no item slot"; extra_info = "no item slot";
can_pick = false; can_pick = false;
break; break;
case eBuyStatus::DEAD:
// Extra info not really needed, and kind of silly to print
can_pick = false;
break;
default: default:
break; break;
} }

View File

@@ -442,7 +442,7 @@ void cPlayer::sort_items() {
eBuyStatus cPlayer::give_item(cItem item, int flags) { eBuyStatus cPlayer::give_item(cItem item, int flags) {
if(main_status != eMainStatus::ALIVE) if(main_status != eMainStatus::ALIVE)
return eBuyStatus::NO_SPACE; return eBuyStatus::DEAD;
bool do_print = flags & GIVE_DO_PRINT; bool do_print = flags & GIVE_DO_PRINT;
bool allow_overload = flags & GIVE_ALLOW_OVERLOAD; bool allow_overload = flags & GIVE_ALLOW_OVERLOAD;

View File

@@ -29,7 +29,7 @@ namespace legacy { struct pc_record_type; };
static struct no_party_t {} no_party; static struct no_party_t {} no_party;
// This enum is now also used in the context of giving items // This enum is now also used in the context of giving items
enum class eBuyStatus {OK, NO_SPACE, NEED_GOLD, TOO_HEAVY, HAVE_LOTS}; enum class eBuyStatus {OK, NO_SPACE, NEED_GOLD, TOO_HEAVY, HAVE_LOTS, DEAD};
enum ePartyPreset {PARTY_BLANK, PARTY_DEFAULT, PARTY_DEBUG}; enum ePartyPreset {PARTY_BLANK, PARTY_DEFAULT, PARTY_DEBUG};