mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Campfires can no longer be yeeted by arrows.
This commit is contained in:
parent
4872d285c3
commit
69bb54b4a2
@ -159,6 +159,6 @@ pub fn handle_create_waypoint(server: &mut Server, pos: Vec3<f32>) {
|
|||||||
animated: true,
|
animated: true,
|
||||||
})
|
})
|
||||||
.with(WaypointArea::default())
|
.with(WaypointArea::default())
|
||||||
.with(comp::Mass(100000.0))
|
.with(comp::Mass(10_f32.powi(10)))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
@ -40,12 +40,15 @@ pub fn handle_knockback(server: &Server, entity: EcsEntity, impulse: Vec3<f32>)
|
|||||||
|
|
||||||
if let Some(physics) = ecs.read_storage::<PhysicsState>().get(entity) {
|
if let Some(physics) = ecs.read_storage::<PhysicsState>().get(entity) {
|
||||||
//Check if the entity is on a surface. If it is not, reduce knockback.
|
//Check if the entity is on a surface. If it is not, reduce knockback.
|
||||||
let impulse = impulse
|
let mut impulse = impulse
|
||||||
* if physics.on_surface().is_some() {
|
* if physics.on_surface().is_some() {
|
||||||
1.0
|
1.0
|
||||||
} else {
|
} else {
|
||||||
0.4
|
0.4
|
||||||
};
|
};
|
||||||
|
if let Some(mass) = ecs.read_storage::<comp::Mass>().get(entity) {
|
||||||
|
impulse /= mass.0;
|
||||||
|
}
|
||||||
let mut velocities = ecs.write_storage::<comp::Vel>();
|
let mut velocities = ecs.write_storage::<comp::Vel>();
|
||||||
if let Some(vel) = velocities.get_mut(entity) {
|
if let Some(vel) = velocities.get_mut(entity) {
|
||||||
vel.0 = impulse;
|
vel.0 = impulse;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user