diff options
author | Led Mitz <smoothshifter@tuta.io> | 2023-04-03 01:58:15 +0000 |
---|---|---|
committer | Led Mitz <smoothshifter@tuta.io> | 2023-04-03 01:58:15 +0000 |
commit | 4887981f15cdae7f19d06471c54e6754e74e6567 (patch) | |
tree | 520bcb4e917054af845d79c070cd775ce48a6150 /src/map/npc.cpp | |
parent | 74ad8e7c214e6ba60fbbeb0f316373e0420460be (diff) | |
parent | 7980f4d21956314e284448f7dcedd58f9c23b355 (diff) | |
download | tmwa-4887981f15cdae7f19d06471c54e6754e74e6567.tar.gz tmwa-4887981f15cdae7f19d06471c54e6754e74e6567.tar.bz2 tmwa-4887981f15cdae7f19d06471c54e6754e74e6567.tar.xz tmwa-4887981f15cdae7f19d06471c54e6754e74e6567.zip |
Merge branch 'item_mode' into 'master'
Item mode
See merge request legacy/tmwa!246
Diffstat (limited to 'src/map/npc.cpp')
-rw-r--r-- | src/map/npc.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/map/npc.cpp b/src/map/npc.cpp index 4d9a8d1..ee2f30c 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -993,6 +993,12 @@ int npc_selllist(dumb_ptr<map_session_data> sd, if (!nameid || sd->status.inventory[item_list[i].ioff2.unshift()].amount < item_list[i].count) return 1; + if (bool(itemdb_search(nameid)->mode & ItemMode::NO_SELL_TO_NPC)) + { + //clif_displaymessage(sd->sess, "This item can't be sold to an NPC."_s); + // M+ already outputs "Unable to sell unsellable item." on return value 3. + return 3; + } if (sd->trade_partner) return 2; // cant sell while trading z += static_cast<double>(itemdb_value_sell(nameid)) * item_list[i].count; @@ -1009,7 +1015,6 @@ int npc_selllist(dumb_ptr<map_session_data> sd, } return 0; - } static |