Remove instance from PoiseChange

This commit is contained in:
Socksonme 2022-06-29 18:27:05 +03:00
parent da0baa674f
commit 6a355c58f2
7 changed files with 4 additions and 13 deletions

View File

@ -55,7 +55,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed an issue where the hurt animation would "jump" whenever you lost/gained health.
- Fixed a bug where, if you dealt any extra damage, such as the extra damage from slashing weapons, the damage would be shown partially.
- Fixed a bug where multiple damage sources in the same tick would show up as a singular attack.
- Fixed an issue where, if the same amount of healing and damage was received in the same tick, nothing would be shown.
- Fixed bug that would sometimes cause taking a screenshot to panic because a buffer was mapped at the wrong time.

View File

@ -287,7 +287,6 @@ impl Attack {
by: attacker.map(|x| x.into()),
cause: Some(damage.damage.source),
time,
instance: damage.instance,
};
if change.abs() > Poise::POISE_EPSILON {
// If target is in a stunned state, apply extra poise damage as health
@ -299,6 +298,8 @@ impl Attack {
amount: health_change,
by: attacker.map(|x| x.into()),
cause: Some(damage.damage.source),
instance: damage.instance,
crit: false,
time,
};
emit(ServerEvent::HealthChange {
@ -379,7 +380,6 @@ impl Attack {
by: attacker.map(|x| x.into()),
cause: Some(damage.damage.source),
time,
instance: rand::random(),
};
emit(ServerEvent::PoiseChange {
entity: target.entity,
@ -527,7 +527,6 @@ impl Attack {
by: attacker.map(|x| x.into()),
cause: Some(attack_source.into()),
time,
instance: rand::random(),
};
emit(ServerEvent::PoiseChange {
entity: target.entity,

View File

@ -29,8 +29,6 @@ pub struct PoiseChange {
pub cause: Option<DamageSource>,
/// The time that the poise change occurred at
pub time: Time,
/// A random instance number used to group up attacks
pub instance: u64,
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]

View File

@ -173,7 +173,6 @@ impl<'a> System<'a> for Sys {
by: None,
cause: None,
time: *read_data.time,
instance: rand::random(),
};
poise.change(poise_change);
poise.regen_rate = (poise.regen_rate + POISE_REGEN_ACCEL * dt).min(10.0);

View File

@ -617,7 +617,6 @@ pub fn handle_land_on_ground(server: &Server, entity: EcsEntity, vel: Vec3<f32>)
by: None,
cause: None,
time: *time,
instance: rand::random(),
};
poise.change(poise_change);
}

View File

@ -189,7 +189,6 @@ impl StateExt for State {
cause: None,
by: damage_contributor,
time: *time,
instance: rand::random(),
};
self.ecs()
.write_storage::<comp::Poise>()

View File

@ -1418,9 +1418,7 @@ impl Hud {
};
fn calc_fade(floater: &HpFloater) -> f32 {
((crate::ecs::sys::floater::MY_HP_SHOWTIME - floater.timer)
* 0.25)
+ 0.2
((crate::ecs::sys::floater::MY_HP_SHOWTIME - floater.timer) * 0.25) + 0.2
}
floaters.retain(|fl| calc_fade(fl) > 0.0);
@ -2118,7 +2116,7 @@ impl Hud {
((crate::ecs::sys::floater::CRIT_SHOWTIME - floater.timer) * 0.75) + 0.5
} else {
((crate::ecs::sys::floater::HP_SHOWTIME - floater.timer) * 0.25) + 0.2
}
}
}
hpfl.floaters.retain(|fl| calc_fade(fl) > 0.0);