mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Addressed feedback
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
use crate::sys::agent::ReadData;
|
||||
use crate::sys::agent::{AgentData, ReadData};
|
||||
use common::{
|
||||
comp::{buff::BuffKind, Alignment, Pos},
|
||||
consts::GRAVITY,
|
||||
@ -70,3 +70,12 @@ pub fn aim_projectile(speed: f32, pos: Vec3<f32>, tgt: Vec3<f32>) -> Option<Dir>
|
||||
pub fn get_entity_by_id(id: u64, read_data: &ReadData) -> Option<EcsEntity> {
|
||||
read_data.uid_allocator.retrieve_entity_internal(id)
|
||||
}
|
||||
|
||||
impl<'a> AgentData<'a> {
|
||||
pub fn has_buff(&self, read_data: &ReadData, buff: BuffKind) -> bool {
|
||||
read_data
|
||||
.buffs
|
||||
.get(*self.entity)
|
||||
.map_or(false, |b| b.kinds.contains_key(&buff))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user