This commit is contained in:
parent
88959c24f9
commit
f1e1fd72af
@ -1,4 +1,3 @@
|
||||
use std::convert::{From, Into};
|
||||
use std::collections::HashMap;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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…
x
Reference in New Issue
Block a user