mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix mindflayer summoning minions inside pillars.
This commit is contained in:
@ -3,7 +3,7 @@ BasicSummon(
|
|||||||
cast_duration: 1.0,
|
cast_duration: 1.0,
|
||||||
recover_duration: 0.5,
|
recover_duration: 0.5,
|
||||||
summon_amount: 6,
|
summon_amount: 6,
|
||||||
summon_distance: (3, 3),
|
summon_distance: (4, 4),
|
||||||
summon_info: (
|
summon_info: (
|
||||||
body: BipedSmall((
|
body: BipedSmall((
|
||||||
species: Husk,
|
species: Husk,
|
||||||
|
@ -16,7 +16,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::{f32::consts::PI, time::Duration};
|
use std::{f32::consts::PI, ops::Sub, time::Duration};
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
|
||||||
/// Separated out to condense update portions of character state
|
/// Separated out to condense update portions of character state
|
||||||
@ -129,16 +129,17 @@ impl CharacterBehavior for Data {
|
|||||||
let ray_vector = Vec3::new(
|
let ray_vector = Vec3::new(
|
||||||
(summon_frac * 2.0 * PI).sin() * length,
|
(summon_frac * 2.0 * PI).sin() * length,
|
||||||
(summon_frac * 2.0 * PI).cos() * length,
|
(summon_frac * 2.0 * PI).cos() * length,
|
||||||
data.body.eye_height(),
|
0.0,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Check for collision on the xy plane
|
// Check for collision on the xy plane, subtract 1 to get point before block
|
||||||
let obstacle_xy = data
|
let obstacle_xy = data
|
||||||
.terrain
|
.terrain
|
||||||
.ray(data.pos.0, data.pos.0 + length * ray_vector)
|
.ray(data.pos.0, data.pos.0 + length * ray_vector)
|
||||||
.until(Block::is_solid)
|
.until(Block::is_solid)
|
||||||
.cast()
|
.cast()
|
||||||
.0;
|
.0
|
||||||
|
.sub(1.0);
|
||||||
|
|
||||||
let collision_vector = Vec3::new(
|
let collision_vector = Vec3::new(
|
||||||
data.pos.0.x + (summon_frac * 2.0 * PI).sin() * obstacle_xy,
|
data.pos.0.x + (summon_frac * 2.0 * PI).sin() * obstacle_xy,
|
||||||
|
Reference in New Issue
Block a user