mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Slightly better bird pathing
This commit is contained in:
parent
69476f46af
commit
74d17ff4c8
@ -223,8 +223,16 @@ impl<'a> System<'a> for Sys {
|
||||
match &mut agent.activity {
|
||||
Activity::Idle { bearing, chaser } => {
|
||||
if let Some(travel_to) = agent.rtsim_controller.travel_to {
|
||||
//if it has an rtsim destination and can fly then it should
|
||||
inputs.fly.set_state(traversal_config.can_fly);
|
||||
// if it has an rtsim destination and can fly then it should
|
||||
// if it is flying and bumps something above it then it should move down
|
||||
inputs.fly.set_state(traversal_config.can_fly && !terrain
|
||||
.ray(
|
||||
pos.0,
|
||||
pos.0 + (Vec3::unit_z() * 3.0))
|
||||
.until(Block::is_solid)
|
||||
.cast()
|
||||
.1
|
||||
.map_or(true, |b| b.is_some()));
|
||||
if let Some((bearing, speed)) =
|
||||
chaser.chase(&*terrain, pos.0, vel.0, travel_to, TraversalConfig {
|
||||
min_tgt_dist: 1.25,
|
||||
|
@ -27,8 +27,8 @@ impl Entity {
|
||||
|
||||
pub fn get_body(&self) -> comp::Body {
|
||||
match self.rng(PERM_GENUS).gen::<f32>() {
|
||||
//we want 75% birds, 25% humans for now
|
||||
x if x < 0.75 => {
|
||||
//we want 50% birds, 50% humans for now
|
||||
x if x < 0.50 => {
|
||||
let species = *(&comp::bird_medium::ALL_SPECIES)
|
||||
.choose(&mut self.rng(PERM_SPECIES))
|
||||
.unwrap();
|
||||
|
@ -88,7 +88,7 @@ pub fn init(state: &mut State, #[cfg(feature = "worldgen")] world: &world::World
|
||||
#[cfg(not(feature = "worldgen"))]
|
||||
let mut rtsim = RtSim::new(Vec2::new(40, 40));
|
||||
|
||||
for _ in 0..10000 {
|
||||
for _ in 0..5000 {
|
||||
let pos = rtsim
|
||||
.chunks
|
||||
.size()
|
||||
|
Loading…
Reference in New Issue
Block a user