fix(gen2): sell TMs at Poké Marts instead of opening the teach party

Selecting a TM in the mart's SELL pack (and the item PC's DEPOSIT pack) opened the teach-party screen: PackMenu:useSelected taught any item carrying `teaches`, even when the pack was built as a chooser (DepositSellPack, world = {}). On the cart that chooser's jumptable is four ScrollingMenus and never reaches tmhm.asm, so the row must hand back to the caller instead.

Gate the teach and field-NOUSE branches behind world.useFieldItem so only the real field PACK teaches; choosers now hand TMs to onChoose. Selling then prices a TM at half its ItemAttributes price -- exactly half of what the Goldenrod/Celadon TM shelves charge, and half of the hidden price for the rest, the way SelectQuantityToSell -> GetItemPrice -> Sell_HalvePrice does on the cart.

Closes #1243
This commit is contained in:
ShaneMcGovernIE
2026-08-13 23:55:31 +01:00
parent 26e9e1d597
commit 1586aec9f6
5 changed files with 94 additions and 12 deletions
+5
View File
@@ -780,6 +780,11 @@ function MartMenu:offerToSell(itemId, count)
end
-- ScrollingMenu's .a_button copies the row's own quantity into
-- wItemQuantity, so the selector's ceiling is how many you hold.
-- The unit price is the item's own ItemAttributes price: GetItemPrice is
-- what SelectQuantityToSell halves AND what the buy list's
-- GetMartItemPrice charges, so a TM sells for exactly half of what the
-- Goldenrod/Celadon TM shelves ask for it, and half of its hidden price
-- (usually ¥1,500) anywhere else (issue #1243).
self.qtyItem = { id = itemId, name = def.name or itemId,
price = def.price or 0 }
self.qty = 1