mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Static aura now uses Object::DeleteAfter instead of Projectile
This commit is contained in:
parent
f90a5272f8
commit
06728c1865
@ -8,8 +8,8 @@ use common::{
|
|||||||
aura::{Aura, AuraKind, AuraTarget},
|
aura::{Aura, AuraKind, AuraTarget},
|
||||||
buff::{BuffCategory, BuffData, BuffKind, BuffSource},
|
buff::{BuffCategory, BuffData, BuffKind, BuffSource},
|
||||||
ship::figuredata::VOXEL_COLLIDER_MANIFEST,
|
ship::figuredata::VOXEL_COLLIDER_MANIFEST,
|
||||||
Alignment, BehaviorCapability, ItemDrops, LightEmitter, Ori, Pos, Projectile,
|
Alignment, BehaviorCapability, ItemDrops, LightEmitter, Ori, Pos, TradingBehavior, Vel,
|
||||||
TradingBehavior, Vel, WaypointArea,
|
WaypointArea,
|
||||||
},
|
},
|
||||||
event::{
|
event::{
|
||||||
CreateAuraEntityEvent, CreateItemDropEvent, CreateNpcEvent, CreateObjectEvent,
|
CreateAuraEntityEvent, CreateItemDropEvent, CreateNpcEvent, CreateObjectEvent,
|
||||||
@ -492,6 +492,7 @@ pub fn handle_create_object(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_create_aura_entity(server: &mut Server, ev: CreateAuraEntityEvent) {
|
pub fn handle_create_aura_entity(server: &mut Server, ev: CreateAuraEntityEvent) {
|
||||||
|
let time = *server.state.ecs().read_resource::<Time>();
|
||||||
let mut entity = server
|
let mut entity = server
|
||||||
.state
|
.state
|
||||||
.ecs_mut()
|
.ecs_mut()
|
||||||
@ -504,16 +505,11 @@ pub fn handle_create_aura_entity(server: &mut Server, ev: CreateAuraEntityEvent)
|
|||||||
|
|
||||||
// If a duration is specified, create a projectile component for the entity
|
// If a duration is specified, create a projectile component for the entity
|
||||||
if let Some(dur) = ev.duration {
|
if let Some(dur) = ev.duration {
|
||||||
let projectile = Projectile {
|
let object = comp::Object::DeleteAfter {
|
||||||
hit_solid: Vec::new(),
|
spawned_at: time,
|
||||||
hit_entity: Vec::new(),
|
timeout: Duration::from_secs_f64(dur.0),
|
||||||
time_left: Duration::from_secs_f64(dur.0),
|
|
||||||
owner: Some(ev.creator_uid),
|
|
||||||
ignore_group: true,
|
|
||||||
is_sticky: false,
|
|
||||||
is_point: false,
|
|
||||||
};
|
};
|
||||||
entity = entity.with(projectile);
|
entity = entity.with(object);
|
||||||
}
|
}
|
||||||
entity.build();
|
entity.build();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user