mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix health last change time not being set properly
This commit is contained in:
parent
5494bd31f2
commit
fa42be75b8
@ -1,4 +1,4 @@
|
|||||||
use crate::sync;
|
use crate::sync::{self, NetSync};
|
||||||
use common::comp;
|
use common::comp;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
@ -30,7 +30,8 @@ macro_rules! comp_packet {
|
|||||||
|
|
||||||
fn apply_insert(self, entity: specs::Entity, world: &specs::World, force_update: bool) {
|
fn apply_insert(self, entity: specs::Entity, world: &specs::World, force_update: bool) {
|
||||||
match self {
|
match self {
|
||||||
$(Self::$component_type(comp) => {
|
$(Self::$component_type(mut comp) => {
|
||||||
|
comp.pre_insert(world);
|
||||||
sync::handle_insert(comp, entity, world);
|
sync::handle_insert(comp, entity, world);
|
||||||
},)*
|
},)*
|
||||||
Self::Pos(comp) => {
|
Self::Pos(comp) => {
|
||||||
@ -47,7 +48,8 @@ macro_rules! comp_packet {
|
|||||||
|
|
||||||
fn apply_modify(self, entity: specs::Entity, world: &specs::World, force_update: bool) {
|
fn apply_modify(self, entity: specs::Entity, world: &specs::World, force_update: bool) {
|
||||||
match self {
|
match self {
|
||||||
$(Self::$component_type(comp) => {
|
$(Self::$component_type(mut comp) => {
|
||||||
|
comp.pre_modify(world);
|
||||||
sync::handle_modify(comp, entity, world);
|
sync::handle_modify(comp, entity, world);
|
||||||
},)*
|
},)*
|
||||||
Self::Pos(comp) => {
|
Self::Pos(comp) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user