fix non-unique team rewards

This commit is contained in:
Martin Michelsen
2024-04-01 23:31:55 -07:00
parent de8a210d0f
commit 4c104443bc
2 changed files with 6 additions and 2 deletions
+6 -1
View File
@@ -4012,11 +4012,16 @@ void send_team_reward_list(shared_ptr<Client> c, bool show_purchased) {
} }
auto s = c->require_server_state(); auto s = c->require_server_state();
// Hide item rewards if the player's bank is full
bool show_item_rewards = show_purchased || (c->current_bank().num_items < 200); bool show_item_rewards = show_purchased || (c->current_bank().num_items < 200);
vector<S_TeamRewardList_BB_19EA_1AEA::Entry> entries; vector<S_TeamRewardList_BB_19EA_1AEA::Entry> entries;
for (const auto& reward : s->team_index->reward_definitions()) { for (const auto& reward : s->team_index->reward_definitions()) {
if (team->has_reward(reward.key) != show_purchased) { // In the buy menu, hide rewards that can't be bought again (that is, unique
// rewards that the team already has). In the bought menu, hide rewards that
// the team does not have.
bool has_reward = team->has_reward(reward.key);
if (show_purchased ? (!has_reward) : (has_reward && reward.is_unique)) {
continue; continue;
} }
if (!show_item_rewards && !reward.reward_item.empty()) { if (!show_item_rewards && !reward.reward_item.empty()) {
-1
View File
@@ -905,7 +905,6 @@
"Description": "Create a Union Guard\nshield", "Description": "Create a Union Guard\nshield",
"IsUnique": false, "IsUnique": false,
"Points": 100, "Points": 100,
// TODO: There are 4 of these in names-v4.json; which should we use?
"RewardItem": "010295", "RewardItem": "010295",
}, { }, {
"Key": "Ticket500", "Key": "Ticket500",