Fix a few cases where return was incorectly used in event systems

This commit is contained in:
crabman 2024-02-12 23:34:00 +01:00
parent 3ad05e4069
commit 8285162967
No known key found for this signature in database
3 changed files with 14 additions and 14 deletions

View File

@ -159,7 +159,7 @@ impl ServerEvent for GroupManipEvent {
"Kick failed, target does not exist.",
));
}
return;
continue;
},
};
@ -172,7 +172,7 @@ impl ServerEvent for GroupManipEvent {
"Kick failed, you can't kick pets.",
));
}
return;
continue;
}
// Can't kick yourself
if uids.get(entity).map_or(false, |u| *u == uid) {
@ -182,7 +182,7 @@ impl ServerEvent for GroupManipEvent {
"Kick failed, you can't kick yourself.",
));
}
return;
continue;
}
// Make sure kicker is the group leader
@ -264,7 +264,7 @@ impl ServerEvent for GroupManipEvent {
"Leadership transfer failed, target does not exist",
));
}
return;
continue;
},
};
// Make sure assigner is the group leader

View File

@ -167,7 +167,7 @@ impl ServerEvent for InventoryManipEvent {
// of the world from the first pickup
// attempt was processed.
debug!("Failed to get entity for item Uid: {}", pickup_uid);
return;
continue;
};
let entity_cylinder = get_cylinder(entity);
@ -177,7 +177,7 @@ impl ServerEvent for InventoryManipEvent {
?entity_cylinder,
"Failed to pick up item as not within range, Uid: {}", pickup_uid
);
return;
continue;
}
// If there's a loot owner for the item being picked up, then
@ -214,7 +214,7 @@ impl ServerEvent for InventoryManipEvent {
});
if !ownership_check_passed {
return;
continue;
}
// First, we remove the item, assuming picking it up will succeed (we do this to
@ -231,7 +231,7 @@ impl ServerEvent for InventoryManipEvent {
"Failed to delete item component for entity, Uid: {}",
pickup_uid
);
return;
continue;
};
// NOTE: We dup the item for message purposes.
@ -702,7 +702,7 @@ impl ServerEvent for InventoryManipEvent {
if let Some(source_item) = inventory.get(source_inv_slot_id) {
if let Some(target_item) = inventory.get(target_inv_slot_id) {
if source_item != target_item {
return;
continue;
}
}
}

View File

@ -78,7 +78,7 @@ impl ServerEvent for InitiateInviteEvent {
"Invite failed, target does not exist.",
));
}
return;
continue;
},
};
@ -88,13 +88,13 @@ impl ServerEvent for InitiateInviteEvent {
.map_or(false, |inviter_uid| *inviter_uid == invitee_uid)
{
warn!("Entity tried to invite themselves into a group/trade");
return;
continue;
}
if matches!(kind, InviteKind::Trade) {
// Check whether the inviter is in range of the invitee
if !within_trading_range(positions.get(inviter), positions.get(invitee)) {
return;
continue;
}
}
@ -108,7 +108,7 @@ impl ServerEvent for InitiateInviteEvent {
inviter,
invitee,
) {
return;
continue;
}
} else {
// cancel current trades for inviter before inviting someone else to trade
@ -141,7 +141,7 @@ impl ServerEvent for InitiateInviteEvent {
"This player already has a pending invite.",
));
}
return;
continue;
}
let mut invite_sent = false;