Fixes the issue mentioned in #1278

This commit is contained in:
Xeriab Nabil 2021-08-12 03:23:31 +03:00
parent 0bedfde53e
commit 8ce679766a

View File

@ -201,27 +201,15 @@ impl<'a> Trade<'a> {
})
.unwrap_or_else(|| format!("Player {}", who));
let offer_header = self
.client
.player_list()
.get(&uid)
.map(|_| {
self.localized_strings
.get("hud.trade.your_offer")
.to_owned()
})
.or_else(|| {
self.client
.state()
.read_storage::<Stats>()
.get(entity)
.map(|_| {
self.localized_strings
.get("hud.trade.their_offer")
.to_owned()
})
})
.unwrap_or_else(|| format!("Player {}", who));
let offer_header = if who == 1 {
self.localized_strings
.get("hud.trade.their_offer")
.to_owned()
} else {
self.localized_strings
.get("hud.trade.your_offer")
.to_owned()
};
Text::new(&offer_header)
.up_from(state.ids.inv_alignment[who], 20.0)