mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Remove randomization of species and body_type with the randomize button in char creation
This commit is contained in:
parent
1ed90bd0bf
commit
1952785af2
@ -42,9 +42,9 @@ impl Body {
|
||||
hair_style: rng.gen_range(0, species.num_hair_styles(body_type)),
|
||||
beard: rng.gen_range(0, species.num_beards(body_type)),
|
||||
accessory: rng.gen_range(0, species.num_accessories(body_type)),
|
||||
hair_color: rng.gen_range(0, species.num_hair_colors()) as u8,
|
||||
skin: rng.gen_range(0, species.num_skin_colors()) as u8,
|
||||
eye_color: rng.gen_range(0, species.num_eye_colors()) as u8,
|
||||
hair_color: rng.gen_range(0, species.num_hair_colors()),
|
||||
skin: rng.gen_range(0, species.num_skin_colors()),
|
||||
eye_color: rng.gen_range(0, species.num_eye_colors()),
|
||||
eyes: rng.gen_range(0, 1), /* TODO Add a way to set specific head-segments for NPCs
|
||||
* with the default being a random one */
|
||||
}
|
||||
|
@ -1257,7 +1257,17 @@ impl Controls {
|
||||
Message::RandomizeCharacter => {
|
||||
if let Mode::Create { name, body, .. } = &mut self.mode {
|
||||
use common::npc;
|
||||
*body = comp::humanoid::Body::random();
|
||||
use rand::Rng;
|
||||
let body_type = body.body_type;
|
||||
let species = body.species;
|
||||
let mut rng = rand::thread_rng();
|
||||
body.hair_style = rng.gen_range(0, species.num_hair_styles(body_type));
|
||||
body.beard = rng.gen_range(0, species.num_beards(body_type));
|
||||
body.accessory = rng.gen_range(0, species.num_accessories(body_type));
|
||||
body.hair_color = rng.gen_range(0, species.num_hair_colors());
|
||||
body.skin = rng.gen_range(0, species.num_skin_colors());
|
||||
body.eye_color = rng.gen_range(0, species.num_eye_colors());
|
||||
body.eyes = rng.gen_range(0, species.num_eyes(body_type));
|
||||
*name = npc::get_npc_name(npc::NpcKind::Humanoid).to_string();
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user