mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
Fix last_pos of new LivingEntity (#777)
* Use pos as last_pos * Passing tests --------- Co-authored-by: FewBlue04 <matthew.dietsch04@gmail.com>
This commit is contained in:
@@ -42,9 +42,10 @@ pub struct LivingEntity {
|
|||||||
}
|
}
|
||||||
impl LivingEntity {
|
impl LivingEntity {
|
||||||
pub fn new(entity: Entity) -> Self {
|
pub fn new(entity: Entity) -> Self {
|
||||||
|
let pos = entity.pos.load();
|
||||||
Self {
|
Self {
|
||||||
entity,
|
entity,
|
||||||
last_pos: AtomicCell::new(Vector3::new(0.0, 0.0, 0.0)),
|
last_pos: AtomicCell::new(pos),
|
||||||
time_until_regen: AtomicI32::new(0),
|
time_until_regen: AtomicI32::new(0),
|
||||||
last_damage_taken: AtomicCell::new(0.0),
|
last_damage_taken: AtomicCell::new(0.0),
|
||||||
health: AtomicCell::new(20.0),
|
health: AtomicCell::new(20.0),
|
||||||
|
|||||||
Reference in New Issue
Block a user