Browse Source

clippystuff

move_stuff_to_libpso
jake 1 year ago
parent
commit
f1e1fd72af
  1. 1
      src/entity/src/character.rs
  2. 4
      src/items/src/state.rs
  3. 4
      src/location/src/lib.rs
  4. 8
      src/login_server/src/character.rs
  5. 4
      src/pktbuilder/src/character.rs
  6. 3
      src/shops/src/tool.rs

1
src/entity/src/character.rs

@ -1,4 +1,3 @@
use std::convert::{From, Into};
use std::collections::HashMap;
use serde::{Serialize, Deserialize};

4
src/items/src/state.rs

@ -240,7 +240,7 @@ impl ItemState {
item_id: ClientItemId(0),
item: InventoryItemDetail::Stacked(StackedItemDetail {
entity_ids: items.iter().map(|i| i.id).collect(),
tool: items.get(0)
tool: items.first()
.ok_or_else(|| ItemStateError::StackedItemError(items.clone()))?
.item
.clone()
@ -284,7 +284,7 @@ impl ItemState {
BankItemEntity::Stacked(items) => {
BankItemDetail::Stacked(StackedItemDetail {
entity_ids: items.iter().map(|i| i.id).collect(),
tool: items.get(0)
tool: items.first()
.ok_or_else(|| ItemStateError::StackedItemError(items.clone()))?
.item
.clone()

4
src/location/src/lib.rs

@ -317,7 +317,7 @@ impl ClientLocation {
.flatten()
.collect::<Vec<_>>();
r.sort_by_key(|k| k.time_join);
let c = r.get(0)
let c = r.first()
.ok_or(GetLeaderError::NoClientInArea)?;
Ok(**c)
}
@ -332,7 +332,7 @@ impl ClientLocation {
.flatten()
.collect::<Vec<_>>();
l.sort_by_key(|k| k.time_join);
let c = l.get(0).ok_or(GetLeaderError::NoClientInArea)?;
let c = l.first().ok_or(GetLeaderError::NoClientInArea)?;
Ok(**c)
}

8
src/login_server/src/character.rs

@ -754,8 +754,8 @@ fn new_character_from_preview(user: &UserAccountEntity, preview: &CharacterPrevi
let mut character = NewCharacterEntity::new(user.id);
character.slot = preview.slot;
character.name = String::from_utf16_lossy(&preview.character.name).trim_matches(char::from(0)).into();
character.section_id = preview.character.section_id.into();
character.char_class = preview.character.ch_class.into();
character.section_id = preview.character.section_id;
character.char_class = preview.character.ch_class;
character.appearance.costume = preview.character.costume;
character.appearance.skin = preview.character.skin;
character.appearance.face = preview.character.face;
@ -810,8 +810,8 @@ impl<'a> SelectScreenCharacterBuilder<'a> {
//model: character.model,
//_unused: [0; 15],
//name_color_checksum: character.name_color_checksum,
section_id: character.section_id.into(),
ch_class: character.char_class.into(),
section_id: character.section_id,
ch_class: character.char_class,
//v2flags: character.v2flags,
//version: character.version,
//v1flags: character.v1flags,

4
src/pktbuilder/src/character.rs

@ -62,8 +62,8 @@ impl<'a> CharacterBytesBuilder<'a> {
ata: stats.ata,
lck: stats.lck + character.materials.luck as u16 * 2,
level,
section_id: character.section_id.into(),
ch_class: character.char_class.into(),
section_id: character.section_id,
ch_class: character.char_class,
costume: character.appearance.costume,
skin: character.appearance.skin,
face: character.appearance.face,

3
src/shops/src/tool.rs

@ -231,9 +231,6 @@ impl<R: Rng + SeedableRng> ToolShop<R> {
else {
let mut techs = Vec::new();
let tier = tier.techs.iter()
.map(|(tech, entry)| {
(tech, entry)
})
.collect::<Vec<_>>();
let tech_choice = WeightedIndex::new(tier.iter().map(|(_, e)| e.probability)).unwrap();

Loading…
Cancel
Save