Skip to content

Commit

Permalink
prevent accepting trade when no trades offered
Browse files Browse the repository at this point in the history
  • Loading branch information
sorokya committed Nov 12, 2023
1 parent d820acd commit f41db1b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/map/map/accept_trade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ impl Map {
None => return,
};

if character.trade_items.is_empty() {
return;
}

let player = match character.player.as_ref() {
Some(player) => player,
None => return,
Expand All @@ -29,6 +33,10 @@ impl Map {
None => return,
};

if partner_character.trade_items.is_empty() {
return;
}

let partner = match partner_character.player.as_ref() {
Some(partner) => partner,
None => return,
Expand Down

0 comments on commit f41db1b

Please sign in to comment.