Allow trading from player to player again

This commit is contained in:
crabman 2024-08-15 13:04:42 +00:00
parent 09825d6769
commit 6277e93911
No known key found for this signature in database

View File

@ -1133,7 +1133,7 @@ impl PlayState for SessionState {
match interactable {
Interactable::Block(_, _, _) => {},
Interactable::Entity(entity) => {
let can_trade_to = client
let can_trade_to_alignment = client
.state()
.read_component_cloned::<Alignment>(*entity)
.is_some_and(|a| match a {
@ -1148,11 +1148,10 @@ impl PlayState for SessionState {
_ => false,
});
if can_trade_to
&& let Some(uid) = client
.state()
.ecs()
.uid_from_entity(*entity)
if let Some(uid) =
client.state().ecs().uid_from_entity(*entity)
&& (can_trade_to_alignment
|| client.player_list().contains_key(&uid))
{
let name = client
.player_list()